Simpler Navigation coming for Servers and Operating Systems
Coming soon: a much simpler Servers and Operating Systems section of the Community. We will combine many of the older boards, and you won't have to click through so many levels to get at the information you need. If you are looking for an older board and do not find it, check the consolidated boards, as the posts are still there.
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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...