Find all executable files within a folder in terminal I have a folder myfolder that contains a huge hierarchy of files/folders.
How to find all executable files within this folder?

On Ubuntu this works: find . -executable -type f

But Mac OS X Mavericks (which also uses bash) fails to get it:

find: -executable: unknown primary or operator
This will find all files (not symlinks) with the executable bit set:

find . -perm +111 -type f


This will also find symlinks (which are often equally important)

find . -perm +111 -type f -or -type l


Here's how the command works if its not obvious:


find is obviously the find program (:
. refers to the directory to start finding in (. = current directory)
-perm +111 = with any of the executable bits set (+ means "any of these bits", 111 is the octal for the executable bit on owner, group and anybody)
-type f means the type is a file
-or boolean OR
-type l means the type is a symbolic link