Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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