DU: HOW TO SEE THE DIRECTORIES THAT TAKE UP THE MOST SPACE


A command that I use a lot to see the space occupied by files and directories is the "du" command.
By setting some parameters it is very convenient to use:

du -sm * | sort -nr | head -5


Head -5 is to return only the first 5 results, you can change it to for example 10 if you want to see more results.
sort -nr is for sorting from heaviest to lightest. So if we use it together with "head -5" we get the 5 things that weigh more.

Need a Drupal Expert?

Senior Drupal developer, freelance, specialized in what's hardest: migrations, multilingual sites, SaaS platforms and Stripe integration. I leverage AI to cut delivery times and costs, with expert review on every line of code.

No agency, no middlemen. Direct contact with the one who does the work.