7

What type of parameter/flag can I use with the unix find command so that I search executables?

(if this question is better suited for another stackexchange forum, I welcome you telling me so)

p.s. If you know of one, I've been looking for a detailed (non-beginner) tutorial/screencast about grep and/or find.

6

Portably, the following command looks for regular files that are executable by their owner:

find . -perm -700 -type f

With GNU find ≥4.3, you can use -executable instead of -perm -700 to look for files that are executable by you.

5

Rather unsurprisingly, -executable. From the man page:

Matches files which are executable and directories which are searchable (in a file name resolution sense). This takes into account access control lists and other permissions artefacts which the -perm test ignores

1

Another option is

find /path -perm /u=x,g=x,o=x -type f

It looks through /path, finds user, global and other executables that are regular files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.