LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   who to use find command (https://www.linuxquestions.org/questions/linux-newbie-8/who-to-use-find-command-376643/)

NalinA 10-25-2005 04:55 AM

How to use find command
 
Is their a way to find out the files that are not owned by system users and users ?

blindcoder 10-25-2005 05:19 AM

Re: How to use find command
 
Quote:

Originally posted by NalinA
Is their a way to find out the files that are not owned by system users and users ?
I'm not sure I understand this correctly: You want to find files that are not owned by a user that is listed in /etc/passwd? If that's the case, try this:

Code:

cmd=""
while read uid ; do
    cmd="${cmd} -a -not -user $uid"
done < <( cat /etc/passwd | cut -f3 -d: | sort -n | uniq )
find / -type f $cmd

Greetings,
Benjamin

Paul7 10-25-2005 08:08 AM

You have to checkout all files which have no owner or group .
this you call see over the ls -lR command. Then check for position of the owner.
If ther is a number nobody is the owner. the same you can do with the group
you understand


All times are GMT -5. The time now is 01:55 PM.