The ProblemIt is a frustrating moment: you try to save a configuration file, download a critical package, or run a database migration, but the system pushes back with a cryptic message:
Disk quota exceeded
This error often feels like a lie. You run df -h and see 50GB of free space on the physical disk. So what gives? On multi-user systems, admins set quotas—artificial ceilings on how much data a specific user can own. When you hit this limit, the system locks your account's write permissions, even if the hardware is half-empty.
Step 1: Diagnosing the UsageFirst, confirm the diagnosis. You need to see exactly how close you are to the edge. The quota command provides a snapshot of your current standing.
# Check your own quota in human-readable format
quota -s
Look closely at the blocks (actual space) and inodes (number of files) columns. If the "usage" matches the "limit," you have found the bottleneck. If you have sudo privileges, you can audit every user on the system at once:
sudo repquota -as
Step 2: Hunting for Space HogsIf increasing the limit isn't an option, you need to start deleting. Don't guess where the data is; use du to find the heaviest folders in your home directory.
# Find the top 10 largest directories
du -ah ~ | sort -rh | head -n 10
Watch out for these common offenders:
- Hidden Runtimes: A
~/.npmor~/.cachefolder can easily balloon to 2GB or 3GB without you ever noticing.- Neglected Logs: Check/var/www/html/logsor your app's local log directory. A single runaway debug log can eat 500MB in a few hours.- The Ghost Trash: Deleting files via a GUI often just moves them to~/.local/share/Trash. They still count against your quota until that folder is purged.## Step 3: Rapid CleanupNeed to get services back online immediately? These commands target the most likely culprits for a quick win:
# Purge bulky package manager caches
npm cache clean --force
yarn cache clean
# Remove Python bytecode that accumulates in dev environments
find . -name "*.pyc" -delete
# Empty the trash bin via the terminal
rm -rf ~/.local/share/Trash/*
Step 4: Adjusting Limits (For Admins)Sometimes the user just needs more room to do their job. Quotas use a "Soft" limit (a warning zone) and a "Hard" limit (the absolute wall). To change these, use edquota, which opens your default text editor.
sudo edquota -u username
The configuration will look like this:
Disk quotas for user dev_user (uid 1001):
Filesystem blocks soft hard inodes soft hard
/dev/sda1 1048576 2097152 2500000 45 0 0
Update the soft and hard blocks. Note that these are typically measured in 1KB blocks, so 2097152 equals 2GB. For a faster, scriptable approach, use setquota:
# Set a 2GB soft limit and 2.5GB hard limit immediately
sudo setquota -u username 2097152 2621440 0 0 /
Verification: Confirming the FixDon't assume it's fixed just because you deleted a few files. Test the write capability with touch:
touch test_file && rm test_file
If the command completes without an error, the block is lifted. Run quota -s one last time to ensure you have a comfortable buffer below your new limit.

