Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SCO Open Server 6 : command help

Status
Not open for further replies.

Tranbo

IS-IT--Management
Apr 14, 2010
75
US
I'm looking for command that will do:

Search for Files in / files system sort by size and put the largest files in the bottom

I RTM and come up with command below but doesn't give me what I'm looking for

#ls -laS

 
Try:

Code:
find / -xdev -type f | xargs ls -ld | sort -n -k 5,5

find searches the specified filesystem, printing out results. -xdev prevents it from crossing filesystem boundaries (e.g. into /usr for example, if it is a separate filesystem), and -type f makes it only print out file names (i.e. not directories, symlinks, etc.). xargs reads those filenames and runs the specified command, ls -ld, against them in bite-sized chunks. Finally the output is sorted numerically by the fifth column, which is the file size.

Annihilannic
[small]tgmlify - code syntax highlighting for your tek-tips posts[/small]
 
Work! exactly what I was looking for. Thank-You! You Rock!

find /u/tmp -xdev -type f |xargs ls -ld |sort -n -k 5,5


-rw-r--r-- 1 root sys 3388778 Jan 4 2008 /u/tmp/01IC7653.PRT
-rw-rw-rw- 1 root sys 4537321 Oct 15 00:58 /u/tmp/n1
-rw-rw-rw- 1 root sys 4557259 Oct 15 01:05 /u/tmp/n2
-rw-r--r-- 1 root sys 5574454 Jan 4 2008 /u/tmp/01IC7649.PRT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top