Operating System - HP-UX
1753886 Members
7488 Online
108809 Solutions
New Discussion юеВ

Re: list in order of size of file

 
SOLVED
Go to solution
bob the spod
Occasional Advisor

list in order of size of file

is there a way i can do a list to bring up the contents of a directory ranked by data size?
Preferbly I would like the largest files at the bottom of the list
it will save me a lot of time searching by a letter at a time!
cheers
bob
you make me feel like dancing (gonna dance the night away!)
5 REPLIES 5
Dietmar Konermann
Honored Contributor

Re: list in order of size of file

ll | sort -rnk 5
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Dietmar Konermann
Honored Contributor
Solution

Re: list in order of size of file

Sorry... at the bottom. :)
ll | sort -nk 5
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
steven Burgess_2
Honored Contributor

Re: list in order of size of file

Hi

ll | sort -nk5

To reverse

ll | sort -rnk5

HTH

Steve
take your time and think things through
Uday_S_Ankolekar
Honored Contributor

Re: list in order of size of file

Go to the directory
du -sk * | sort -n

-USA..
Good Luck..
Rodney Hills
Honored Contributor

Re: list in order of size of file

Usually I do a-
ll | sort -n -r +4 -5 | more

This way I see the largest files first. If you drop "-r" then it will be smallest size first.

Another good utility to use is "du". It can do totallying on subdirectories as well. A common practice I use is.

cd /somepath
du -s * | sort -n | more

To find the largest subdirectories in the current directory.

HTH

-- Rod Hills
There be dragons...