Skip to main content

๐Ÿ–ฅ๏ธ Checking Disk Size in Linux | The Best Tools for the Job ๐Ÿš€

Monitoring Disk Usage in Linux | Top Tools for Keeping Storage in Check

Published Markdown
๐Ÿ–ฅ๏ธ Checking Disk Size in Linux | The Best Tools for the Job ๐Ÿš€

If you're running Linux, keeping an eye on your disk usage is crucialโ€”especially if your storage starts filling up mysteriously. ๐Ÿ˜ฑ Fortunately, Linux provides several powerful tools to check disk size, monitor usage, and clean up space when needed. Let's explore some of the best ways to get a disk space reality check and how to hunt down those space-hogging files.


๐Ÿ” 1. Using df -H (Disk Free)

The df (disk free) command is a quick and easy way to check the size and available space of mounted filesystems.

Run the following command in your terminal:

df -H

This will display something like:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1      500G  320G  180G  64% /
tmpfs          4.2G  2.1M  4.2G   1% /dev/shm
/dev/sdb1      2.0T  1.3T  700G  65% /mnt/data

โœ… Why use df -H?

โœ”๏ธ Quick overview of disk usage
โœ”๏ธ Shows total disk size, used space, and free space
โœ”๏ธ -H makes the output human-readable (e.g., GB instead of bytes)


๐Ÿ“Š 2. Checking Disk Usage with btop

For a modern and interactive view of system performance, btop is an awesome tool.

Install btop:

sudo apt install btop -y   # Debian/Ubuntu
sudo dnf install btop -y   # Fedora/RHEL

Then, simply run:

btop

You'll get a real-time dashboard with CPU, memory, network, and disk usage stats. ๐Ÿ•ต๏ธโ€โ™‚๏ธ

โœ… Why use btop?

โœ”๏ธ Real-time monitoring of disk usage
โœ”๏ธ Graphical interface (without needing a GUI)
โœ”๏ธ Great for tracking disk activity and bottlenecks


๐Ÿ† 3. The Best Tool for Finding Large Files: ncdu

If you're running out of space and need to find the biggest offenders, ncdu (NCurses Disk Usage) is the ultimate tool. ๐Ÿ”ฅ

Install ncdu

sudo apt install ncdu -y   # Debian/Ubuntu
sudo dnf install ncdu -y   # Fedora/RHEL

Run ncdu in the root directory to scan everything:

sudo ncdu /

This will scan your entire system and present a sortable, interactive list of the largest files and directories. You can navigate using the arrow keys and even delete files directly from the interface by pressing d. ๐Ÿ—‘๏ธ

โœ… Why is ncdu the best?

โœ”๏ธ Faster than du (Disk Usage)
โœ”๏ธ Sorts files by size automatically
โœ”๏ธ Interactive interface makes cleanup easy
โœ”๏ธ Saves time when dealing with full disks


๐ŸŽฏ Wrapping Up

Linux gives you many ways to check your disk usage, but the best approach depends on what you're trying to do:

๐Ÿ›  Need a quick summary? โ†’ Use df -H
๐Ÿ“Š Want real-time stats? โ†’ Use btop
๐Ÿ” Need to track down big files? โ†’ Use ncdu

If you're dealing with low disk space, ncdu is the best tool to hunt down and delete unnecessary files. Happy cleaning! ๐Ÿงนโœจ

Got questions or need more tips? Drop them below! โฌ‡๏ธ

About the author

No comments yet. Be the first to comment.