Search code examples
linuxterminalcommandfile-permissionsfedora12

command for filtering files by permissions


I need to recursively search a directory in Linux(Fedora core 12) and filter files based on permissions.

But by using find -perm I am able to filter files based on specific permissions. Like for eg., files with permissions as 777 or 007.

Is it possible to search with wildcards using the find -perm command?? For e.g., list the files with read, write, execute permissions for 'others'(root and group can have any kind of permission).

Also is it possible just to display the count of the list of files matched by the filter and not the list of files itself??

Thanks in advance.


Solution

  • Is it possible to search with wildcards using the find -perm command?? For e.g., list the files with read, write, execute permissions for 'others'(root and group can have any kind of permission).

    Yes, use -perm -007 with a minus before the 007, which will set the minimal condition.

    Also is it possible just to display the count of the list of files matched by the filter and not the list of files itself??

    command | wc -l
    

    instead of

    command