Sorting Disk Usage By Size On Linux

Tux - the linux logo

More of a reminder for myself than anything else .. since I’ve got a terrible memory!

If you want to check disk space usage from the command line you can use the “du” command.

But if you want to check a large number of directories for usage and sort them so that you can see where all the disk space is gone to use:

du -sh * | sort -h

That will output it in a more human readable fashion with the directory using the most diskspace appearing last ie. where you can see it.

Published
Categorised as Linux Tagged

By Michele Neylon

Michele is founder and CEO of Irish hosting provider and domain name registrar Blacknight.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Exit mobile version