The Sector Allocation Audit Vector
When operating a headless Ubuntu Linux server, the concept of a graphical pie chart detailing storage consumption is mathematically nonexistent. If your server is logging millions of external HTTP requests, the localized `.log` files will eventually consume every available sector on the physical solid-state drive. If a Linux partition hits exactly 100% capacity, the kernel cannot write critical operational data to the drive, causing the OS to violently crash or lock you out of SSH entirely. You must routinely command the core OS to dump the raw telemetry of its partition allocation directly to the terminal.
How to Check Disk Space in Ubuntu
The UNIX architecture provides two distinct God-level binaries for auditing storage: `df` (Disk Free) to analyze total partition capacity, and `du` (Disk Usage) to perform surgical audits on specific nested directories.
1. Open your terminal application or connect to the server via SSH.
2. Method 1: The Partition Audit (The `df` Daemon):
* This is the mathematically optimal pathway to view the macro-level health of your entire drive structure.
* Type exactly:
df -h
* Press Enter.
* The Output Matrix: The daemon will output a structured table of every mounted filesystem.
* The Critical Flags: The `-h` flag is absolute. It instructs the daemon to format the raw byte data into “Human-readable” strings (e.g., Megabytes (M) and Gigabytes (G)). Without it, the OS will dump millions of raw integer blocks, which is computationally frustrating to read.
* Look under the Mounted on column for the `/` (root) directory. Trace the row across to the Use% column to mathematically verify if your primary OS partition is nearing catastrophic capacity (e.g., 95%).
3. Method 2: The Localized Directory Audit (The `du` Daemon):
* If `df -h` reveals your drive is full, you must isolate the specific directory causing the bloat (e.g., a massive database backup folder).
* Navigate to the suspected directory using `cd` (e.g., cd /var/log).
* Type exactly:
sudo du -sh *
* Press Enter.
* The Output Matrix: The `du` daemon recursively scans every file and sub-directory within your current location and calculates the total payload.
* The Critical Flags: The `-s` (summarize) flag prevents the daemon from printing every single file, instead outputting one massive total per folder. The `-h` flag ensures the output is in MB/GB.
* The output will display a stark list of folders and their exact gigabyte consumption, allowing you to surgically target the bloated payload for deletion.