Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

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.