How to Check Available Disk Space in Ubuntu Using the Command Line

The Capacity Monitoring Vector

When operating a headless Ubuntu Linux server, monitoring disk capacity is a critical administrative duty. Because the system lacks a graphical file manager or visual capacity bars, administrators can easily be caught completely unaware when a hard drive suddenly reaches 100% utilisation (which often leads to catastrophic database corruption or server crashes). You must be able to query the exact available capacity of all mounted filesystems directly from the terminal.

How to Check Available Disk Space

The standard tool for querying filesystem capacity in Linux is the df (disk free) command.

1. Open your terminal or connect to your server via SSH.
2. To view the raw, detailed block statistics for all mounted drives, execute the base command:

df

3. However, raw block numbers are exceptionally difficult to read. To format the output into human-readable measurements (Megabytes and Gigabytes), execute the command with the -h flag:

df -h

4. The terminal will immediately output a cleanly formatted table. The Size column indicates total capacity, the Used column shows current consumption, the Avail column displays exactly how much space remains, and the Use% column provides a rapid visual percentage.

By regularly checking the primary mount point (usually /), you can intercept storage bottlenecks long before they trigger a system failure.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.