find command options
I need some help listing files that have certain permisions.
What I want is a list of all files that have the execute attribute set for the owner. I need the search to be done recursively in a directory specified by me.
For this, I have found the command find, but the following line
find -perm u=x -maxdepth 10
did not produce any output, although it was run in a directory with subdirectories containing executable files.
What am I doing wrong?
Hi there, try:
find /home/whatever/top_directory_to_start_search_in -maxdepth 10 -user fred -perm -+x
this will find executables for user fred to depth of 10 sub-directories.
Thanks a lot, it works.
Is there a way to leave out directories from this list?
Looking at what find can do, it has -prune but this only stops it from descending into the directory. I would suggest, unless somebody knows different, writing a shell script that runs several find commands and outputs them to files or does what you need to do to them. I suggest this as then in my opinion it is more controllable and customizable.
You can add "-type f".
Originally Posted by Dexter123