How to Check Disk Space in Ubuntu

The Storage Interrogation Vector

Unlike a graphical Windows environment that displays a simple, color-coded pie chart of your hard drive capacity, a headless Linux server provides zero visual warnings when storage is critically low. If your MySQL database suddenly fills the remaining physical sectors on the SSD, the entire server will instantly crash and refuse to boot. You must routinely command the Unix kernel to interrogate all mounted partitions and output a mathematically precise diagnostic of available storage blocks.

How to Check Disk Space

The Ubuntu operating system relies on the highly efficient `df` (disk free) command-line utility to rapidly calculate and report block usage across all active file systems.

1. Open your terminal application or connect to the server via SSH.
2. The Basic Command (Unreadable Output): If you simply type `df` and press Enter, the kernel will output the data in raw 1-kilobyte blocks. This massive string of numbers is mathematically accurate but completely illegible to a human operator.
3. The Human-Readable Override (Recommended): You must append the `-h` (human-readable) flag to the command. This forces the utility to calculate the raw blocks and translate them into familiar Megabytes (MB), Gigabytes (GB), and Terabytes (TB).

df -h

4. Press Enter.
5. Analyzing the Output Matrix:
* The terminal will generate a tabular grid.
* Filesystem: This column lists the physical hardware partition (e.g., `/dev/sda1` or `/dev/nvme0n1p2`).
* Size: The absolute maximum capacity of that specific partition.
* Used / Avail: Exactly how much data is currently written, and exactly how much free space remains.
* Use%: A rapid, percentage-based visual indicator. If this number is above 90%, you are in critical danger of a system crash.
* Mounted on: This is the most crucial column. Look for the row where the “Mounted on” value is a single forward slash (`/`). This represents the primary root directory of your server, where the core operating system and all primary databases are stored.

Get the best tech tips delivered straight to your inbox.

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