Computing.Net > Forums > Unix > ls command

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

ls command

Reply to Message Icon

Name: woojin yu
Date: March 24, 2001 at 09:04:29 Pacific
Comment:

how do you list files in decreasing order of file size? there has to be an option in ls, right?



Sponsored Link
Ads by Google

Response Number 1
Name: DMR
Date: March 25, 2001 at 02:21:46 Pacific
Reply:

Try "ls -S"; that should list files starting with the largest first.


0

Response Number 2
Name: WolfieK
Date: March 26, 2001 at 06:20:08 Pacific
Reply:

hi woojin yu,

"ls -S" is not supported on all unix platforms.
use "ls -al | sort -a -k5" instead, where "k5" is the fifth column of "ls -al", the column which contaiŽns the filesize (on most derivatives)

greet$
Wolfie


0

Response Number 3
Name: WolfieK
Date: March 27, 2001 at 04:51:55 Pacific
Reply:

sorry, it should be written as:

ls -al | sort -A -k 5

or

ls -al | sort -Ar -k 5 (reverse order


greet$
Wolfie


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: ls command

help with ls command www.computing.net/answers/unix/help-with-ls-command/4232.html

proper use of ls command www.computing.net/answers/unix/proper-use-of-ls-command/6852.html

ls help www.computing.net/answers/unix/ls-help/3769.html