My VPS disk usage is already 96% so I have to find a way to search for the largest files/directories in Linux and check if they should be deleted or not. Â I’m sure I can find files such as web log files which I can delete.
There isn’t any 1 linux command to do this but you can string a couple of commands to do the job. Here’s what I use.
# du -a /home | sort -n -r | head -n 300
- du : Estimate file space usage
- sort : Sort lines of text files or given input data
- head : Output the first part of files i.e. to display first 10 largest file
Better yet, you can run it in your background using this
# du -a /home | sort -n -r | head -n 300 > spacehog.txt &
This will create a text file called spacehog.txt which you can review later after the background process finished.
Best Deal Ads :






where’s your VPS, noel?
I use rapidvps.