How to issue "ls" command start with the largest file size in a folder?
Hi,
How do I use the command "ls" to display the largest file size in a folder? |
the most i could come up with is ls -s which gives you the size of all the files. i got this in the man pages
Code:
[matt@cpe-69-133-112-109 sounds]$ ls -s |
sort by size largest first
Code:
ls -S |
I would be inclined to use ls -lrS, which gives a long listing, sorted by size, with the largest last in the list (and therefore not scrolled off the screen).
|
ls -sSr and ls -sS are both also useful.
|
hello fjkum. i guess you can also use du for that.
smallest first (recursive) Code:
du * | sort -n Code:
du * | sort -nr Code:
du * -s | sort -n Code:
du * -s | sort -nr Code:
du * -s | sort -nr | cut -f 2 Code:
du * -s -b | sort -nr |
All times are GMT -5. The time now is 06:36 AM. |