Home » Questions » Computers [ Ask a new question ]

See folder size breakdown in Linux?

See folder size breakdown in Linux?

Is there any command that could show me the size of several folders in linux, perhaps ranked from biggest to smallest?

Asked by: Guest | Views: 319
Total answers/comments: 4
Guest [Entry]

"As others said, du is the way to go. But knowing the options to du is essential. Here they are:

du -m --max-depth 1 /foo /bar

This will give you the size in megabytes of the directories contained in /foo and /bar. If you want the output to be sorted, pipe it through the sort utility:

du -m --max-depth 1 /foo /bar | sort -n -k 1"
Guest [Entry]

du [options] [directories and/or files]
Guest [Entry]

du [options] [directories and/or files]
Guest [Entry]

"From the command line I prefer to list the biggest last so I use:

du -shm ./* | sort -n"