Find executable files recursively

commandexecutablefindrecursive

I have got the directory called Test and a few directories inside it. Both Test and the directories inside it have executable files. I'd like to print them with ls. I'd use this command.

ls -l `find Test/ -perm /u=x,g=x,o=x -type f`

Is this a good/right/quick command or not?

My solution is:

find Test/ -executable -type f -exec ls -l {} \;

and got the same result as warl0ck and pradeepchhetri offered.

Best Answer

Not really, you can integrate the ls command with find,

find Test/ -type f -perm /u=x,g=x,o=x -exec ls -l {} \;

UPDATE

Actually -executable is not an equivalent of -perm /u=x,g=x,o=x. You might have files that is executable only by the group or others, which will not be displayed.

So, depends on your purpose, if you want files executable only by you, that's okay to use -executable.

Related Question