Find the answer to your Linux question:
Results 1 to 5 of 5
Hey, Guys! Can anyone one help me with designing a command that will find all executable files(executable via a limited user's account) ? I think that must be something like ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2006
    Posts
    2

    How to find all executable files?


    Hey, Guys!

    Can anyone one help me with designing a command that will
    find all executable files(executable via a limited user's account)
    ?

    I think that must be something like "find -perm xxxxxxx"


    Thank you.

  2. #2
    Just Joined!
    Join Date
    Mar 2006
    Posts
    9
    umm..mm I've never use find command . I suggest u to use grep instead..
    Code:
    grep -r xxxx  *.x
    or
    Code:
    grep -r xxxx  *.*
    or
    Code:
    grep -r xxxx  *
    xxxx is filename path. and it xxxx is also word in file

  3. #3
    Just Joined! jojojo's Avatar
    Join Date
    May 2005
    Location
    Kuala Lumpur, Malaysia
    Posts
    99
    Log in as root and type
    Code:
    which filename 
    eg. which mplayer
    or
    Code:
    echo $PATH
    . Usually, an executable program reside on /usr/bin directory.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,133
    I think he's more looking for a way to identify random files that are executable. Something like this may work
    Code:
     find -perm 111 -exec echo {} \;
    find -perm 333 -exec echo {} \;
    find -perm 777 -exec echo {} \;
    etc as bits which contain exectuable instruction. You are supposed to be able to do this using 'mode' along with perm but it doesn't seem to work for me, or at least is a lot slower.

  6. #5
    Just Joined!
    Join Date
    Nov 2007
    Posts
    1

    generic solution

    In unix there is a command called 'file' which will determine the file type of any file.
    $file gimptool-2.0
    will for instance give you:
    gimptool-2.0: Bourne shell script text executable

    Andreas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •