Find the answer to your Linux question:
Results 1 to 5 of 5
I need some help listing files that have certain permisions. What I want is a list of all files that have the execute attribute set for the owner. I need ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Posts
    2

    find command options


    I need some help listing files that have certain permisions.
    What I want is a list of all files that have the execute attribute set for the owner. I need the search to be done recursively in a directory specified by me.

    For this, I have found the command find, but the following line
    find -perm u=x -maxdepth 10
    did not produce any output, although it was run in a directory with subdirectories containing executable files.

    What am I doing wrong?

  2. #2
    Linux Newbie
    Join Date
    Jan 2008
    Location
    UK
    Posts
    211
    Hi there, try:

    find /home/whatever/top_directory_to_start_search_in -maxdepth 10 -user fred -perm -+x

    this will find executables for user fred to depth of 10 sub-directories.

  3. #3
    Just Joined!
    Join Date
    Mar 2008
    Posts
    2

    thank you

    Thanks a lot, it works.
    Is there a way to leave out directories from this list?

  4. #4
    Linux Newbie
    Join Date
    Jan 2008
    Location
    UK
    Posts
    211
    Looking at what find can do, it has -prune but this only stops it from descending into the directory. I would suggest, unless somebody knows different, writing a shell script that runs several find commands and outputs them to files or does what you need to do to them. I suggest this as then in my opinion it is more controllable and customizable.

  5. #5
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    Quote Originally Posted by Dexter123 View Post
    Thanks a lot, it works.
    Is there a way to leave out directories from this list?
    You can add "-type f".

Posting Permissions

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