Something I’m always curious about is where my disk space always goes. Honestly, it’s amazing how quickly you can fill up a hard drive these days. Linux has a great tool called ‘du’ (disk usage) that we can leverage to see where all our GB are escaping to.

There’s a few flags you’ll want to use before you just go and start using ‘du’ only.

Navigate to the directory you would like to check up on, in this case, my web server root:

$ cd /var/www/
$ du --max-depth=1 -h
58M	./
32M	./stock_wordpress
17M	./
106M	.

So I’m using 106MB of disk space with websites currently. This can be extremely useful with large media sites.

Let’s look at those flags:

--max-depth=1 - Tells us to only look at the current directory and the folders in it, not recursively
-h - 'Human Readable', so you'll get things like 10M or 54G

For all the flags hit up the man pages with:

$ du man

Posted by Chris Klosowski

Chris Klosowski is the President of Easy Digital Downloads, the easiest way to sell your digital products with WordPress. Trusted by over 50,000 smart store owners.