If your disk space is full on your Linux server, or is approaching 100%, in this tutorial we will show you how to troubleshoot which directories are using up the most usage.

STEP #1: Log into your server via SSH as root.

STEP #2: Check the current disk space using df-h command.

STEP #3: Check which are the top 10 directories according to the size: du -a /home | sort -n -r | head -n 10

This command can give you the details, if you need in exact size in KB’s. Use ‘h’ in options.

du -ah /home | sort -n -r | head -n 10

du : Shows space usage.
sort : Sort lines of the files.
head : Shows beginning of the files
find  : Shows search results

Now you have the results of total disk space, top 10 directories and it’s exact size. You will need to check into each directories and see what is in there and act accordingly.

You can also use ducks command to find it.

Then just run ducks , you get the details:

These are the troubleshooting related commands for identifying large directories within a Linux server environment.

Server Hosting Solutions by RackNerd:

Shared Hosting
cPanel Web Hosting in US, Europe, and Asia datacenters
Reseller Hosting
Create your new income stream today with a reseller account
VPS (Virtual Private Server)
Fast and Affordable VPS services - Instantly Deployed
Dedicated Servers
Bare-metal servers, ideal for the performance-demanding use case.

Leave a comment

Your email address will not be published. Required fields are marked *