1

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?

1

Yes find should be capable of that:

find /path/to/dir -type f -perm /ugo=x
| 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 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.