The Spatial Audit Vector
When an Ubuntu server reaches 98% storage capacity on its primary solid-state drive, critical system daemons will mathematically crash as they fail to write log files, and MySQL databases will instantly corrupt. To resolve this catastrophic space constraint, you cannot randomly delete small `.txt` files. You must instruct the Linux kernel to execute a deep spatial audit across the entire directory structure, calculating the exact byte size of every file and mathematically sorting them to isolate the massive, space-consuming anomalies (like a 50GB forgotten `.tar.gz` backup or an infinitely expanding `error.log`).
How to Find Large Files in Ubuntu
The Ubuntu command-line architecture possesses powerful native utilities, primarily `du` (disk usage) and `find`, which can be piped into sorting algorithms to generate precise forensic reports.
1. Open your terminal application or connect to the server via SSH.
2. Method 1: The Directory Audit (`du` + `sort`):
* This is the mathematically superior method for identifying which specific folders are consuming the most space, allowing you to trace the bloat down the directory tree.
* Navigate to the root directory (or whichever directory you suspect is bloated): cd /
* Type exactly (requiring `sudo` to bypass permission blocks):
sudo du -a -h --max-depth=1 | sort -hr
* Press Enter.
* Parsing the Data: The kernel will output a list of directories in descending order based on their physical byte size (e.g., `12G /var`, `4.5G /usr`). You can then `cd` into `/var` and run the exact same command again to drill deeper into the specific folder causing the issue.
3. Method 2: The Surgical Strike (`find`):
* If you do not want to hunt through folders, and instead want the kernel to instantly output a list of individual files that exceed a specific mathematical threshold (e.g., every file larger than 500MB).
* Type exactly:
sudo find / -type f -size +500M -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
* Press Enter.
* Parsing the Data: The kernel will scan the entire SSD (`/`) and output the absolute file path and exact size of every single file over 500 Megabytes (e.g., `/var/log/syslog: 2.1G`).
4. Method 3: The Interactive GUI Matrix (`ncdu`):
* If you find raw terminal output too difficult to parse, you can install the `ncdu` utility, which generates an interactive, navigable interface directly within the terminal.
* Install it: sudo apt install ncdu -y
* Execute it: sudo ncdu /
* The utility will scan the drive and build a visual list. You can use your keyboard arrow keys to navigate down the directory structure and hit the `d` key to instantly delete bloated files.