Find disk space usage on a Linux machine

If you are running several websites or accounts on a medium sized VPS ( In this tutorial, I am focusing only on linux machines) , you may have encountered a “disk space full” situation. There are several ways to find out disk space usage. I am going to use a ‘find’ command along with awk to list all the files and directories with size more than 100 MB. 

 find / -type f -size +100000k -exec ls -lh {} \; 2>/dev/null | awk '!/\(var| usr | proc | home \/virtfs) / {print $9 ": " $5}'

Here is a screenshot of the given command. 

 

Similarly, you can change required fill size by adding or removing zeros to the -size parameter. 

Leave a Reply

Your email address will not be published. Required fields are marked *