POSIX find all non readable files

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite












I am trying to find all non readable 'ACL-wise' in a subdirectory owned by another user www-data, and that on a 'FreeBSD' server. This server prevents me from using the command find . ! -readable



How could I find all the non-readable (by the current user) files in a directory?










share|improve this question









New contributor




Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Similar: How to recursively check if a specfic user has read access to a folder and its contents?
    – Stéphane Chazelas
    8 hours ago














up vote
4
down vote

favorite












I am trying to find all non readable 'ACL-wise' in a subdirectory owned by another user www-data, and that on a 'FreeBSD' server. This server prevents me from using the command find . ! -readable



How could I find all the non-readable (by the current user) files in a directory?










share|improve this question









New contributor




Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Similar: How to recursively check if a specfic user has read access to a folder and its contents?
    – Stéphane Chazelas
    8 hours ago












up vote
4
down vote

favorite









up vote
4
down vote

favorite











I am trying to find all non readable 'ACL-wise' in a subdirectory owned by another user www-data, and that on a 'FreeBSD' server. This server prevents me from using the command find . ! -readable



How could I find all the non-readable (by the current user) files in a directory?










share|improve this question









New contributor




Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I am trying to find all non readable 'ACL-wise' in a subdirectory owned by another user www-data, and that on a 'FreeBSD' server. This server prevents me from using the command find . ! -readable



How could I find all the non-readable (by the current user) files in a directory?







find posix






share|improve this question









New contributor




Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 4 hours ago









Stéphane Chazelas

283k53522859




283k53522859






New contributor




Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 8 hours ago









Pierre-Antoine Guillaume

213




213




New contributor




Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • Similar: How to recursively check if a specfic user has read access to a folder and its contents?
    – Stéphane Chazelas
    8 hours ago
















  • Similar: How to recursively check if a specfic user has read access to a folder and its contents?
    – Stéphane Chazelas
    8 hours ago















Similar: How to recursively check if a specfic user has read access to a folder and its contents?
– Stéphane Chazelas
8 hours ago




Similar: How to recursively check if a specfic user has read access to a folder and its contents?
– Stéphane Chazelas
8 hours ago










1 Answer
1






active

oldest

votes

















up vote
7
down vote













You can always do:



find . -exec sh -c '
for file do
[ -r "$file" ] || printf "%sn" "$file"
done' sh +


To list the files you don't have read permission for.



Note that for symlinks, that checks the target of the symlink.



It also obviously won't report files in directories you don't have read permission to (which may contain files you have read access to (provided you have search access to the directory) and/or files you don't have read access to).



On FreeBSD, you should also be able to do:



find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'


Or



sudo find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'


To also list the files in the directories you don't have read access to.



(neither sudo, -print0 nor perl are specified by POSIX).






share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    Pierre-Antoine Guillaume is a new contributor. Be nice, and check out our Code of Conduct.









     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f468736%2fposix-find-all-non-readable-files%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    7
    down vote













    You can always do:



    find . -exec sh -c '
    for file do
    [ -r "$file" ] || printf "%sn" "$file"
    done' sh +


    To list the files you don't have read permission for.



    Note that for symlinks, that checks the target of the symlink.



    It also obviously won't report files in directories you don't have read permission to (which may contain files you have read access to (provided you have search access to the directory) and/or files you don't have read access to).



    On FreeBSD, you should also be able to do:



    find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'


    Or



    sudo find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'


    To also list the files in the directories you don't have read access to.



    (neither sudo, -print0 nor perl are specified by POSIX).






    share|improve this answer


























      up vote
      7
      down vote













      You can always do:



      find . -exec sh -c '
      for file do
      [ -r "$file" ] || printf "%sn" "$file"
      done' sh +


      To list the files you don't have read permission for.



      Note that for symlinks, that checks the target of the symlink.



      It also obviously won't report files in directories you don't have read permission to (which may contain files you have read access to (provided you have search access to the directory) and/or files you don't have read access to).



      On FreeBSD, you should also be able to do:



      find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'


      Or



      sudo find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'


      To also list the files in the directories you don't have read access to.



      (neither sudo, -print0 nor perl are specified by POSIX).






      share|improve this answer
























        up vote
        7
        down vote










        up vote
        7
        down vote









        You can always do:



        find . -exec sh -c '
        for file do
        [ -r "$file" ] || printf "%sn" "$file"
        done' sh +


        To list the files you don't have read permission for.



        Note that for symlinks, that checks the target of the symlink.



        It also obviously won't report files in directories you don't have read permission to (which may contain files you have read access to (provided you have search access to the directory) and/or files you don't have read access to).



        On FreeBSD, you should also be able to do:



        find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'


        Or



        sudo find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'


        To also list the files in the directories you don't have read access to.



        (neither sudo, -print0 nor perl are specified by POSIX).






        share|improve this answer














        You can always do:



        find . -exec sh -c '
        for file do
        [ -r "$file" ] || printf "%sn" "$file"
        done' sh +


        To list the files you don't have read permission for.



        Note that for symlinks, that checks the target of the symlink.



        It also obviously won't report files in directories you don't have read permission to (which may contain files you have read access to (provided you have search access to the directory) and/or files you don't have read access to).



        On FreeBSD, you should also be able to do:



        find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'


        Or



        sudo find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'


        To also list the files in the directories you don't have read access to.



        (neither sudo, -print0 nor perl are specified by POSIX).







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 7 hours ago

























        answered 8 hours ago









        Stéphane Chazelas

        283k53522859




        283k53522859




















            Pierre-Antoine Guillaume is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            Pierre-Antoine Guillaume is a new contributor. Be nice, and check out our Code of Conduct.












            Pierre-Antoine Guillaume is a new contributor. Be nice, and check out our Code of Conduct.











            Pierre-Antoine Guillaume is a new contributor. Be nice, and check out our Code of Conduct.













             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f468736%2fposix-find-all-non-readable-files%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            List of Gilmore Girls characters

            What does second last employer means? [closed]

            One-line joke