LINUX group/user ID searching...
Results 1 to 5 of 5

Thread: LINUX group/user ID searching...

  1. #1

    Question LINUX group/user ID searching...

    I have been trying to find a command on how to search for files with certain user group permissions. I am not having any luck so thats why I decided to come here . All I need is a command that checks user/group ID and lists the corresponding file name and location. If there is not one yet.. I will make one :P
    .::nataS is WaTchiNg::.

  2. #2
    Senior Member problemchild's Avatar
    Join Date
    Jul 2002
    Posts
    551
    The find command will do it just fine. What permissions are you wanting to search for? This will search for all SUID and SGID files and output the result to suidfiles.txt. You can play with the permissions to find the particular files you want.

    /usr/bin/find / -type f \( -perm -004000 -o -perm -002000 \) -exec ls -lg {} \; 2>/dev/null >suidfiles.txt
    Do what you want with the girl, but leave me alone!

  3. #3
    ok... heres a sample listing...

    #ls -al
    -rw-r--r-- 1 var_x users 0 Tue Jan 05 12:40:14 2000 file
    -rw-r--r-- 1 var_x users 0 Mon Dec 25 13:00:00 2002 file2
    I want to search for all files with owner/group ID equal to var_x or similar... do you understand what im trying to ask?
    .::nataS is WaTchiNg::.

  4. #4
    Senior Member problemchild's Avatar
    Join Date
    Jul 2002
    Posts
    551
    Use the command I gave you but change the -perm to -user or -group and insert the appropriate user or group to search for.

    You can try something like:

    /usr/bin/find / -type f -user problemchild -exec ls -lg {} \; 2>/dev/null >problemchildfiles.txt

    That will search for all files with owner problemchild and output the results to a text file.

    man find will tell you more.
    Do what you want with the girl, but leave me alone!

  5. #5
    ah thanks.. that works perfect.. if you ever need help with something dont hesitate to pm me or IM me @ sjunglist187
    .::nataS is WaTchiNg::.

Posting Permissions

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