How can I find out where all my disk space has gone on a Linux file system?

Learn how to use the Linux du command to discover what directories are consuming the most space in your file system.

By Arnold Robbins
March 21, 2017
Screen from "How can I find out where all my disk space has gone on a Linux file system?" Screen from "How can I find out where all my disk space has gone on a Linux file system?" (source: O'Reilly)

Administrators of Linux systems must often determine how the disk space is being utilized in their system. Learning how to effectively use the du (disk usage) command makes it easy to quickly hone in on the directories that are consuming the most disk space. In this video, you will learn how to run the du command combined with a sort command and a sed command, to quickly show the top 5 directories taking up the most space in your file system.

Learn more about useful shell commands in Arnold Robbins’ video course Robust Shell Scripting. Start now with a free 10-day trial to Safari.

Learn faster. Dig deeper. See farther.

Join the O'Reilly online learning platform. Get a free trial today and find answers on the fly, or master something new and useful.

Learn more

Arnold Robbins is a professional software engineer who has worked with UNIX systems since 1980. The author of more than a dozen O’Reilly titles, including Linux in a Nutshell, Effective awk Programming, and the Bash Pocket Reference, Arnold is a master communicator who holds a BA in Information Science from Yeshiva University and an MS in Computer and Information Science from Georgia Tech.

Post topics: Software Engineering
Post tags: Questions
Share: