How to Check Your Disk Space in Ubuntu

The Capacity Exhaustion Vector

A headless Linux server will fail catastrophically if its primary storage drive reaches 100% capacity. Log files cannot be written, database transactions will instantly halt, and the operating system may refuse to allow SSH connections entirely. You must proactively monitor the physical storage allocation across all mounted partitions to ensure you never cross the critical threshold of 95% capacity.

How to Check Your Disk Space

The Ubuntu operating system relies on the highly efficient `df` (Disk Free) command-line utility to rapidly interrogate the kernel’s file system tables and report total sector usage.

1. Open your terminal application or connect to your server via SSH.
2. If you simply type `df` and press enter, the utility will output the storage data in raw 1K blocks. This is mathematically precise but incredibly difficult for a human to parse at a glance (e.g., `40411232` instead of `40 GB`). You must force the utility to translate the data into human-readable formats like Megabytes (MB) and Gigabytes (GB).
3. Type the following command exactly as written, using the `-h` (human-readable) flag:

df -h

4. Press Enter.
5. Analyzing the Telemetry: The terminal will generate a formatted table. You must ignore the complex `tmpfs` and `loop` file systems, which are virtual drives created by Snap packages and the kernel.
* Look down the far-left column (Filesystem) until you locate your primary physical hard drive partition. It will usually be named something like `/dev/sda1`, `/dev/nvme0n1p1`, or simply `/`.
* Read horizontally across that specific row. The most critical column is Use%. If this number is above 90%, you are in imminent danger of a critical server failure and must immediately begin purging old log files or resizing the partition.

Get the best tech tips delivered straight to your inbox.

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