Now that you understand the basics of checking and managing disk space, you can dive deeper into related commands and techniques. We recommend these guides for your next steps:
Table of Contents
Linux Disk Space Commands at a Glance
df -hT
How to Check Inode Usage in Linux
To empty a large log file, use the truncate command. For example, to empty a file named large-app.log:Here are a few safe places to start cleaning to reclaim disk space.RunCloud is designed to simplify every aspect of your server management workflow, including health monitoring. Instead of manually running commands, you get a clean, visual dashboard that displays your disk usage, CPU load, and memory at a glance. More importantly, you can configure alerts to be notified automatically when your disk space reaches a critical threshold, giving you plenty of time to act before it impacts your applications.

du -h ./webapps/ | sort -rh | head -n 10
df -i
How to Find What’s Using Disk Space in Linux
However, logging in to manually check your disk space isn’t always practical, and by the time you realize there’s a problem, it might already be too late. A modern server control panel is the answer for those who want to move from reactive troubleshooting to proactive management.This is a very common point of confusion. If df reports that a disk is 95% full but du only accounts for 85% of the space, there are usually two reasons for this:
Reserved Space: Most Linux filesystems (like ext4) reserve a percentage of the disk (typically 5%) exclusively for the root user. This safety measure prevents essential system services from crashing if a regular user fills up 100% of the disk. df includes this reserved space in its calculation of used space, while du only sums up the actual files it can see.
Deleted Files Held Open by a Process: In Linux, when you delete a file (e.g., a large log file), the space is not freed until the program that was using it closes the file. du will immediately stop seeing the deleted file and won’t count its size. However, df knows the space is still allocated on the disk until the process is restarted or ends. This is why it’s better to truncate active log files instead of deleting them.df -h /home
How to Show Filesystem Type in Linux
You can specify the path if you only care about the space in a specific directory (like your home folder). For example:Sign up for RunCloud today and discover how effortless server management can be!
How to Use du to Check Disk Usage
sudo dnf clean all
Generally, it is safe to delete older files from the /tmp directory, as it is intended for temporary data that applications no longer need. However, you should avoid deleting files that are actively being used, so it’s best to remove files that haven’t been accessed in a while. The safest approach is to let the system handle it, as most Linux distributions are configured to clear the /tmp directory automatically during a reboot.The du
command has several useful options depending on whether you need a quick summary or a detailed breakdown. Here are the most common ways to use it.sudo truncate -s 0 /var/log/large-app.log
sudo apt clean
sudo apt autoremove
Whether you’re running a SaaS platform, client websites, or internal infrastructure, this guide will help you stay ahead of downtime.
How to Use ncdu for Interactive Disk Usage in Linux
In this guide, we’ll show you the exact commands to check disk usage, find what’s consuming space, and free up storage before it impacts your business.

GUI Tools to Check Disk Space in Linux (Baobab, Filelight)
Commands like df and du work everywhere, but sometimes a visual tool makes it faster to understand disk usage.
- Disk Usage Analyzer (Baobab): The default tool for GNOME-based desktops like Ubuntu. It provides a visual ring chart that makes it easy to see the largest directories.
- Filelight: A similar tool for the KDE Plasma desktop environment. This tool displays the disk usage using visual charts, which makes it easy to gather information about your filesystem at a glance.
How to Free Up Disk Space in Linux
sudo yum clean all
How to Manage Large Log Files Safely
If you are using Linux with a graphical desktop environment, you have even more intuitive options.
How to Clean the Package Manager Cache in Linux
The -s
flag can be used to get a summary of disk usage. This command shows a single numerical value, which is the total size of the directory.du -sh .
How to List Sizes of Top-Level Directories in Linux
This is a fantastic command-line tool that scans a directory and then provides an interactive, navigable list. You can use your arrow keys to drill down into folders and quickly see what’s using the most space. To install ncdu on Debian and Ubuntu-based systems, run the command sudo apt install ncdu. For CentOS and RHEL systems, you can install it using sudo yum install ncdu. Once the installation is complete, you can scan the current directory by running the command sudo ncdu
.The df command has several useful options that make it easier to narrow down problems, check filesystem types, and track inode usage.Here are the most common commands to check disk space in Linux and what they do:This is where RunCloud shines.Think of df as your car’s fuel gauge – it shows the total space used and free. du is like the trip computer – it shows which files and folders are using the space.
You use df to determine whether you have a problem and du to locate the problem.The simplest way to check disk space in Linux is with the df command. It shows free and used space across all mounted filesystems, making it the quickest way to see if you’re running out of storage.
How to Review User and Temporary Files
- /home Directory: Personal files, downloads, and documents are stored here. Use the du commands you learned earlier to navigate your home directory (/home/your-username) and find large files or directories that you no longer need.
- /tmp Directory: This directory is used for temporary files. While most systems clear it on reboot, sometimes files can be left behind. It’s worth checking this directory for any old, large files that can be removed.
Key Takeaways on Checking Disk Space in Linux
Package managers (like apt for Ubuntu/Debian or dnf/yum for Fedora/CentOS) download and store installation files in a cache. After installation, these files are often no longer needed. This is usually the safest and easiest way to free up a good amount of space.An inode is a data structure on the filesystem that stores all the information about a file except for its name and actual data. If you run out of inodes, you won’t be able to create new files or directories, even if you still have plenty of physical disk space left. This situation is most common on systems with millions of very small files, so checking inode usage with df -i is an important diagnostic step if you cannot save new files on a disk that appears to have free space.Once you’ve confirmed that a disk is nearly full, the next step is cleanup. Start with safe methods like clearing package caches or truncating large logs. Be careful not to delete system files you don’t recognize – that can break your server.While you could delete a log file with rm, it’s not recommended. A running application may still be “holding” the file open, leading to issues. A safer method is to truncate the file, emptying its contents without deleting it.For Debian and Ubuntu-based systems:
These two commands will remove old installation files and any unused dependency packages. df -h
sudo du -h --max-depth=1
How to Find the Largest Directories in Linux
A simple du -h
lists the size of every subdirectory, but that can be overwhelming. These options make du
far more practical: