nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

find out info. reg. files for each user in the system

This is a discussion on find out info. reg. files for each user in the system within the Solaris/OpenSolaris forums, part of the UNIX operating systems category; 1) I have a requirement where in I need to find and sort files user wise in a folder. The ...

Register free or login to your existing account and remove all advertisements.


Go Back   nixCraft Linux Forum > UNIX operating systems > Solaris/OpenSolaris

Linux answers from nixCraft.


Solaris/OpenSolaris Discuss all about the SUN Solairs/OpenSolaris. You are free to talk about any issues related to Solaris administration, networking, services and other stuff, share information or ask doubts.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-12-2005, 04:14 PM
ganes
Guest
 
Posts: n/a
Default find out info. reg. files for each user in the system

1) I have a requirement where in I need to find and sort files user wise in a folder. The files can be situated in any subfolder that may also be hidden.
The files then need to be sorted according to size and date of creation.

2) Can we find out files for users who's entry is not there in /etc/passwd.
Reply With Quote
  #2 (permalink)  
Old 09-13-2005, 03:09 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
Default Re: find out info. reg. files for each user in the system

Quote:
1) I have a requirement where in I need to find and sort files user wise in a folder. The files can be situated in any subfolder that may also be hidden. The files then need to be sorted according to size and date of creation.
You can use sort and ls command to do the task. Are you on solaris or linux? Then I can give you command

Quote:
2) Can we find out files for users who's entry is not there in /etc/passwd.
All users must have entry in /etc/passwd.. then users can login in and create files. So some sort of user always needed to create file ownership.
Reply With Quote
  #3 (permalink)  
Old 09-14-2005, 11:54 AM
ganes
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #4 (permalink)  
Old 09-15-2005, 01:53 AM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
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
  #5 (permalink)  
Old 09-15-2005, 07:54 PM
ganes
Guest
 
Posts: n/a
Default

thanks,
agreed...but can I sort ...say ...the output of ls -al, user wise and then save file entries for every user in a seperate file..so I can have disk usage status of every user in that folder.

this would be a great help....

ganesh.
Reply With Quote
  #6 (permalink)  
Old 09-20-2005, 07:45 PM
rockdalinux's Avatar
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 691
Thanks: 15
Thanked 18 Times in 17 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
Default

cant u use ls command?

ls -al | sort -n +{FIELD}
__________________
Rocky Jr.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
  #7 (permalink)  
Old 09-20-2005, 07:49 PM
rockdalinux's Avatar
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 691
Thanks: 15
Thanked 18 Times in 17 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
Default

Just read man pages of ls and sort. Do u wanna output sorted just home dir wise or what?
__________________
Rocky Jr.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
howto get my cpu info on linux system? chiku Linux software 4 05-20-2008 09:06 PM
UNIX command to find out whether particular process of a particular user is running Santosh Sharma Shell scripting 1 01-17-2008 04:26 PM
can not find user name in /etc/passwd file subrata1in Linux software 2 03-26-2007 11:44 AM
Linux find and delete files cbzee Linux software 4 12-20-2006 01:01 PM
USER INFO asim.mcp Linux software 1 08-09-2006 04:18 AM


All times are GMT +5.5. The time now is 08:34 AM.


Powered by vBulletin® Version 3.8.4 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38