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 Answer 1
Yes find should be capable of that:
find /path/to/dir -type f -perm /ugo=x
answered Sep 22, 2012 at 19:56
cYrus
22.4k9 gold badges79 silver badges81 bronze badges
-
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 linesab– sab2012年09月22日 20:30:05 +00:00Commented Sep 22, 2012 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– cYrus2012年09月22日 20:34:42 +00:00Commented Sep 22, 2012 at 20:34
You must log in to answer this question.
lang-bash