HOW TO FIND THE LARGEST FILES OR DIRECTORIES ON YOUR VPS
October 30, 2015 / by Marco / Categories : Software, Technology
My CentOS VPS was running out of space so I needed to do a bit of a clean up and decided to see which files and directories used up the most space. So after some digging around I found these two commands.
This one is to find the largest 10 directories:
find . -type d -print0 | xargs -0 du | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {}
This one is to find the largest 10 files:
find . -type f -print0 | xargs -0 du | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {}

If you want to display more than 10 results then change the tail -10 to another amount. I then found a couple of large xml files and deleted these which freed up over 2 GB of data.
Our Sponsors
- Advertise Me Pty Ltd
Digital Signage Solutions
OTHER ARTICLES YOU MAY LIKE
USE FUSEBASE TO AUTOMATE TEAMWORK AND COLLABORATION
If your business is growing, your team is juggling too many moving parts, and your client communication is spread across email threads, chat apps, documents, task boards, and endless follow ups, there is a good chance the real problem is not effort but fragmentation. Most businesses do not lose time because people are lazy. They […]
read more
USING REAP FOR VIDEO CLIPS
Short form video is now one of the most effective ways to reach new audiences, grow brand awareness, and turn long form content into a steady stream of social media assets. For creators, marketers, consultants, educators, and business owners, the challenge is rarely a lack of content. The real problem is time. Editing long videos […]
read more


