Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to write a script to find all executable files under a specific directory which I want to pass in parameter. I am able to find all executable files using a predefined directory but I want to be able to just pass a directory name and the script finds the directory in the file system and find all executable under it.

Can I do this with find command?

share|improve this question

Yes find should be capable of that:

find /path/to/dir -type f -perm /ugo=x
share|improve this answer
Hi cYrus, thanks for the quick response. The problem is I dont have the path, I need to find the path to the directory name passed in command line – sab Sep 22 '12 at 20:30
Can you elaborate? According to what criteria you need to find the path from another path passed as an argument? Let's say the input path is /foo/bar/ and then? – cYrus Sep 22 '12 at 20:34

Your Answer


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.