Skip to content

How to find large files via SSH on a server.

Oct 15, 2015 | Server Administration

There are times when you need to figure out what is filling up disk space on a server or other device (block storage, CDN, external storage, etc) and quickly!

Things like:

  • runaway logging
  • backups & backup of backups
  • large archives
  • dev or beta areas for testing and development work
  • clients or customers who suddenly upload a lot of files

The command you want to run in order to output where large files exist is:

find / -type f -size +1048576k -exec ls -lh {} ; 2> /dev/null | awk ‘{ print $NF “: ” $5 }’  | sort -nrk 2,2

The above would look for files greater than 1 gigabyte in size and then output the path to those files so you could further examine them. You can modify this for any file size [change -size +1048576k] to further refine your search criteria. You can output and sort this data to the screen or to a file just as easy.

Contact Us Today!

"*" indicates required fields

I would like to be contacted by:*

Join Our Newsletter List!

* indicates required