Skip to main content
Ramblings

Main navigation

  • Home
User account menu
  • Log in

Breadcrumb

  1. Home

Command of the month: Do you du?

By Andrew, 3 March, 2019

While I do like and use the GUI DiskUsageAnalyzer and the ncurses-based Ncdu to examine disk usage on Linux systems, there is something that feels good about getting back to basics and using command line tools like the du (disk usage) command once and a while. While there is no doubt that using the command line does require a little more effort and might even  necessitate an occasional trip to a man page, the simplicity and power of commands like the following appeal my inner minimalist:

du -h --max-depth=2 | sort -hr

This command (which lists and sorts disk usage of directories two levels down from the point of execution) not only returns information faster than any GUI tool can, but it is much easier to use in automated scripts or via cron to auto-generate reports and the like.

Monthly archive

  • January 2018 (2)
  • March 2018 (1)
  • April 2018 (2)
  • October 2018 (1)
  • January 2019 (2)
  • March 2019 (2)
  • April 2019 (1)
  • May 2019 (2)
  • July 2019 (1)
  • September 2019 (1)
  • October 2019 (1)
  • February 2020 (2)
  • July 2021 (1)
  • February 2022 (1)
  • April 2022 (1)
  • June 2022 (1)
  • August 2022 (1)
  • October 2022 (2)
Ramblings
Powered by Drupal