HOW TO FIND THE LARGEST FILES OR DIRECTORIES ON YOUR VPS
October 30, 2015 / by Marco / Categories : Software, TechnologyMy 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
POWERFUL REFERRAL PROGRAM TOOL
Businesses of all sizes are constantly seeking new and innovative ways to grow their customer base and increase brand awareness. With the rise of social media and the reliance on word-of-mouth marketing, referral programs have become an essential tool for companies looking to expand their reach. However, managing a successful referral program can be a […]
read moreCYBER SECURITY PLATFORM FOR YOUR BUSINESS
Cyber security has become a top priority for individuals and organizations alike. With the ever-evolving threat of cyber attacks, it is imperative to have a strong and reliable security platform in place to protect sensitive information and data. That’s where Bleach Cyber comes in. As a leading cyber security platform, Bleach Cyber is dedicated to […]
read more