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.
1 |
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.
Hi! This is my first comment here so I just wanted to give a quick shout out and tell you I genuinely enjoy reading through your blog posts. Can you recommend any other blogs/websites/forums that cover the same topics? Appreciate it!