Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-25-2005, 04:55 AM   #1
LQ Newbie
Registered: Oct 2005
Distribution: RHEL4
Posts: 7

Rep: Reputation: 0
How to use find command

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

Last edited by NalinA; 10-25-2005 at 05:09 AM.
Old 10-25-2005, 05:19 AM   #2
ROCK Linux
Registered: Dec 2003
Location: Berlin, Germany
Distribution: Crystal ROCK
Posts: 108

Rep: Reputation: 15
Re: How to use find command

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:

while read uid ; do
    cmd="${cmd} -a -not -user $uid"
done < <( cat /etc/passwd | cut -f3 -d: | sort -n | uniq )
find / -type f $cmd
Old 10-25-2005, 08:08 AM   #3
Registered: Aug 2005
Location: Thailand
Distribution: Suse 10.2 / Win XP Home
Posts: 172

Rep: Reputation: 30
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find/grep command to find matching files, print filename, then print matching content stefanlasiewski Programming 9 06-30-2016 05:30 PM
Find command ? hpladd Linux - Newbie 5 08-09-2005 09:42 PM
find command slack66 Slackware 8 03-14-2005 03:17 PM
help with the find command clockworks Linux - Software 2 02-17-2004 04:24 PM
find command talkinggoat Linux - Newbie 4 10-05-2003 02:04 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:50 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration