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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find and sort files by size

Status
Not open for further replies.

we2aresame

Technical User
Feb 10, 2003
128
CA
Can anyone help me to find and sort files by size? thanks.
 
du -sk | sort -n gives you file size in KBytes in ascending order (smallest first) in the current directory.

Or something like this will find files larger than 20480 bytes. But I would imagine it would take a long time to run:

find / -xdev -size +20480 -ls|sort -r +6|head -10

What is it you are trying to do?
 
Thank you, on AIX, I did some minor changes:

find / -xdev -size +20480c -ls|sort -r +4|head -10
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top