View Single Post

  #4 (permalink)  
Old 09-15-2005, 12:53 AM
monk's Avatar
monk monk is offline
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 481
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Quote:
Originally Posted by ganes
I am working on Solaris 9.0
Can I use sort for the any field.
I have seen many files that are situated somewhere on the system and are owned by users who's IDs are either deleted or suspended. Can we find out these files by comparing the user validity in /etc/passwd.
Oh ok I got it your question, here is what you need to do:
You can pass the -nouser -nogroup option to find command:

Display list of files/dirs where user/group does not exists in (user) /etc/passwd (group) /etc/group file
Code:
find / -nouser -nogroup -print
Or better find out all files/dirs and save all such files to nouser.txt file
Code:
find /home -nouser -nogroup  >nousers.txt
Let us come to sorting question
Use ls command, under solaris the output is sorted alphabetically by default.
No UNIX and Linux OS stores the date of creation. They only stores the access/modification time so you cannot find out date of creation, however you can get the last accessed/modification date/time stamp via ls -c command.

If you have a GNU find command then you can also try following else use above command on Solaris:
Code:
find /home -nouser -nogroup  -fprint nousers.txt
Reply With Quote