Articles in this section

How to find large files

Disk space issues. Like disk space not freeing up after deleting files.

For problems with your system partition, unmount all but your system folders using the:

 

sudo umount -a command.

Run the following command to search for files larger than 1GB. Disregard findings which include /proc/.

 

sudo find / -name '*' -size +1G
Any file found larger than 1GB is a likely suspect for further investigation, especially any file found on one of the user's mount points. Mount points will normally be empty unless a device is mounted to it.
If the backup contains many smaller folders, such as a music collection, rather than look for one large file the user may wish to look at the combined folder size. In this case, run the following command. It will look for folders using more than 1GB of space if the grep option is included.

 

sudo du -hd 1 /

This will show the folders in the root and only one level deep to identify the folders containing large amount of data.

 

sudo du -h --max-depth=1 / | grep '[0-9]G\>'
Once large folders are located, you can refine the search by identifying a specific folder as the starting point and/or increase the maxdepth level. The folders /usr, /root, and /home will normally be included in the results. If all your mount points are in the /media folder, your search might be: sudo du -h --max-depth=2 /media.

To test:
du -h /|grep M|sort -nr|head -15

du -h to have readable output
grep M to prevent sorting large numbersK
head instead of tail so that it doesn't have sort more than necessary
sort -r to reverse the order for head

du -h | sort -nr| grep [0-9]M | head -20


Also check for large log files like the kernel.log/syslog files at /var/log/

Was this article helpful?
0 out of 0 found this helpful