LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-25-2005, 04:55 AM   #1
NalinA
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
blindcoder
ROCK Linux
 
Registered: Dec 2003
Location: Berlin, Germany
Distribution: Crystal ROCK
Posts: 108

Rep: Reputation: 15
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
 
Old 10-25-2005, 08:08 AM   #3
Paul7
Member
 
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
 
  


Reply


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


All times are GMT -5. The time now is 03:42 PM.

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