The other day I was browsing around one of our Linux servers and noticed that there was a ton of storage being used.
This machine is normally used as a staging environment for various projects and client work, so it was surprising to see that almost 8 gigs had been taken up.
Normally most people with this issue would have to resort to poking around their filesystem or FTP to find the files or folders taking up the space.
Instead of doing that, I decided to break out some Linux wizardry and let my server do the work for me. If you don’t have Linux experience that’s OK! All you need to be able to do is follow some very simple directions.
Not going to waste any more time, here is how to find the biggest files on your linux server / hosting account:
1. You need ssh access. If you don’t have ssh access ask your host.*
2. Log into your server with root level access.*
3. Once you are at a command prompt, enter this command:
du -a / | sort -n -r | head -n 10
4. You can run the command again to search deeper within your filesystem if you want. For instance, if you want to only search within your home directory you would replace the “/” with “/home”. If you want to go deeper than that you can search for sub folders within a directory.
In this case we searched /home to see which domains were taking up the largest space.
You should see something along the lines of this:
After I ran this, I realized we had just uploaded 5 .MOV files to our test server for a client website. So nothing to worry about at all.
I also found a directory that had a ton of old backups of sites we no longer manage, that totaled almost 1 GB, so it was good to get rid of those as well (of course, after backing them up first).
What just happened??
This command basically searched your filesystem for the 10 largest files and sorted them by size. This command is actually 3 commands piped together to form one.
This command can be very useful to search /mail directories within individual directories to see which users have the largest boxes.
If you have a cloud hosting plan that is dependent on how much space you use, this method can also come in very handy.
*disclaimer – being logged in as root on your hosting account can seriously mess things up. Always backup your stuff!
Hello I'm Patrick Coombe and I'm the CEO and Founder of Elite Strategies, an agency I started in 2009. One of the main reasons I love blogging about SEO is the research it takes to come up with the posts. It allows me to not only write about what I love, but to learn more about the industry in the process. I hope you enjoyed this post, if you did consider sharing it or even better linking to it!
It was only a matter of time before something like this was created. I mean, they already index every site on the internet, so why not make a tool to make them? In a recent blogspot post by Google/Doubleclick, they announced: Google will soon launch Google Web Designer, an HTML5…
Leveraging the Lynx browser In my opinion, viewing your site in lynx is one of the most powerful SEO tools at your disposal. For those that don't know, lynx is an console based web browser that has been around forever. Google actually recommends that you look at your website in…
Last evening, our CEO Patrick Coombe was invited to speak to the class, thanks to Dr. Henry Schrader. "It felt great to be back in a classroom and around academia in general. The new international business building is nothing short of a work of art, and everyone at Lynn, especially…