HOW TO FIND THE LARGEST FILES OR DIRECTORIES ON YOUR VPS

October 30, 2015   /   by Marco  / Categories :  Software, Technology
HOW TO FIND THE LARGEST FILES OR DIRECTORIES ON YOUR VPS

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 {}

Business Legions Find Largest Directories

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 {}

Business Legions Find Largest Files

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.

 

DO YOU LIKE WHAT YOU'VE READ?
Join our subscription list and receive our content right in your mailbox. If you like to receive some Great deals our Freebies then subscribe now!

Our Sponsors

  • Follow us:

OTHER ARTICLES YOU MAY LIKE


HOW TO GET FREE UPGRADE TO PERPLEXITY.AI PRO FOR 12 MONTHS AND TESTING PRO FEATURES

HOW TO GET FREE UPGRADE TO PERPLEXITY.AI PRO FOR 12 MONTHS AND TESTING PRO FEATURES

If you spend time researching, comparing, or synthesising information online, you have probably encountered Perplexity.ai — a research-focused assistant that blends large language models with live web search and citation trails. The Pro plan supercharges that experience with priority access to powerful models, higher usage limits, and premium capabilities baked directly into the interface. Right […]

read more
VidTechy: The Ultimate Tool for AI-Powered Video Optimization

VidTechy: The Ultimate Tool for AI-Powered Video Optimization

Unlock the potential of your videos with VidTechy, the ultimate AI-powered tool for seamless video optimization and enhanced viewer engagement.

read more

Like our Page