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 | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
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. |
|
|||
|
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. |
|
||||
|
Quote:
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 Code:
find /home -nouser -nogroup >nousers.txt 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 |
|
||||
|
cant u use ls command?
ls -al | sort -n +{FIELD}
__________________
Rocky Jr. You may have my body & soul, but you will never touch my pride! If you have knowledge, let others light their candles at it. Certified to work on HP-UX / Sun Solaris / RedHat |
|
||||
|
Just read man pages of ls and sort. Do u wanna output sorted just home dir wise or what?
__________________
Rocky Jr. You may have my body & soul, but you will never touch my pride! If you have knowledge, let others light their candles at it. Certified to work on HP-UX / Sun Solaris / RedHat |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| howto get my cpu info on linux system? | chiku | Linux software | 4 | 05-20-2008 08:06 PM |
| UNIX command to find out whether particular process of a particular user is running | Santosh Sharma | Shell scripting | 1 | 01-17-2008 03:26 PM |
| can not find user name in /etc/passwd file | subrata1in | Linux software | 2 | 03-26-2007 10:44 AM |
| Linux find and delete files | cbzee | Linux software | 4 | 12-20-2006 12:01 PM |
| USER INFO | asim.mcp | Linux software | 1 | 08-09-2006 03:18 AM |