du command sort by maximum size first


I am new to Debain/Linux

How do we list folder size has maximum size

using du command. How we can get maximum file size on the top

I mean I want du command sort by maximum size first

Who is Participating?
Maciej SConnect With a Mentor sysadminCommented:
Use sort for this:
du -sk * | sort -n
or sort -r (to reverse your sorted output).
fosiul01Connect With a Mentor Commented:
have a look this one


if you want to do suppose top 10

du -sk * | sort -nr | head -10
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.