Show disk usage in descending order

If you need to find the amount of disk space being consumed in Linux/Unix, you can show it recursively through your directories as follows.

$ du -ks * | sort -gr
  11927760 Library
  7729280 Desktop
  5408572 Music
  118840 Downloads
  99740 Pictures
  79668 zabbix
  74300 Documents
  1048 Sites
  856 Movies
  300 Applications
  228 macserv-snmpwalk.txt
  8 yo_zimbra_template.xml
  8 enable_snmp.pl
  4 switch.cfg-snmpenabled.cfg
  4 switch.cfg
  4 support-Evault.txt
  4 Windows-Licenses.txt
  0 Public

This command will show the disk usage in reverse order, highest amount of space first starting from the present working directory.

jhudgins has written 31 articles

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>