Results 1 to 9 of 9
Hello,
I'm trying to search executable files (from current and sub-directories included) using find.
What is the correct syntax ?
Or other preferred tools for a such research ?
Thanks ...
- 03-28-2009 #1Linux Newbie
- Join Date
- Dec 2008
- Location
- Luxembourg
- Posts
- 130
find : how to search executable files ?
Hello,
I'm trying to search executable files (from current and sub-directories included) using find.
What is the correct syntax ?
Or other preferred tools for a such research ?
Thanks for help.
Bruno
- 03-28-2009 #2Just Joined!
- Join Date
- Mar 2009
- Location
- Melbourne
- Posts
- 17
Hope this helps -
http://www.linuxforums.org/forum/lin...ble-files.html
ofcourse u will need to change the code a little bit, to make the search exclusive for the directory or sub directory want to check.
- 03-30-2009 #3Linux Enthusiast
- Join Date
- Aug 2006
- Location
- Portsmouth, UK
- Posts
- 539
You'll want to use find with -perm
man is your friend
RHCE #100-015-395
Please don't PM me with questions as no reply may offend, that's what the forums are for.
- 03-31-2009 #4
find is indeed the correct program for this. However, you will run into an issue here.
When you say "executable", what exactly do you mean? Do you mean executable for you? Or executable for anyone? Remember, a file can have its executable permission set for any combination of the owner, controlling group, or others.
As a result, you'll have to play with the "-perm" flag to make sure that it's checking for _any_ of the permissions, not the exact permission.DISTRO=Arch
Registered Linux User #388732
- 04-06-2009 #5
use the find command with the -perm tag as pointed by others. If you want to search the current dir then put the path in the find commmand as the same.
- 04-15-2009 #6Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,970
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 04-19-2009 #7Linux Newbie
- Join Date
- Dec 2008
- Location
- Luxembourg
- Posts
- 130
Precisely, I'm looking for a way to search executable files only.
- 04-19-2009 #8Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,970
Assuming you want to find particular strings inside of executables, then use the find command with the -perm option (read the find man page) and -exec option in conjunction with the strings command piped to grep -l to end up with a list of executable that contain the specific strings you are interested. I leave the exact syntax up to you as a learning exercise. Read the docs and man pages for details how to do this.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 05-02-2009 #9Linux Newbie
- Join Date
- Dec 2008
- Location
- Luxembourg
- Posts
- 130
(note: as described I'm not looking for a specific string inside executables).
Indeed usage of 'find' with parameter -exec + needed options allows the research of only executables files.
Thanks for attention.
Bruno


Reply With Quote

