Running out of disk space on Linux can feel sudden and frustrating. One moment everything runs smoothly, and the next, updates fail, applications slow down, or the system refuses to cooperate. This problem is common, especially on systems that run for long periods without maintenance. Fortunately, Linux gives you some useful tools and methods to identify the issue and fix it step by step without breaking your system.
The Effects of Low Disk Space on Linux
Low disk space on Linux causes far more trouble than you might think. The system needs free space for temporary files, logs, lock files, memory swapping, and everyday tasks. The first thing I notice when my Linux hard drive is running out of space is that everything slows down. Programs open slowly, the desktop lags, and simple tasks can freeze.
Apps often crash without warning because they can’t create the files they need to run properly. Plus, package managers like APT or DNF require space to download and install packages, and when there’s no room left, the process stops halfway and leaves the system in a broken, frustrating state.
These are just some of the many ways low disk space affects a Linux system; there are plenty more issues that can crop up. However, let’s explore what you can do with your Linux system if your hard drive is running out of space.
Check Disk Usage
The first thing you need to do is check and understand where your disk space is being used. You can start with your system’s built-in graphical tools. For example, if you’re on GNOME, the Disk Usage Analyzer (Baobab) gives you a clear visual breakdown of what’s taking up space. Similarly, on KDE, Filelight does the same job with an interactive chart.

If you’re comfortable working from the terminal, or if you’re on a server, the command line gives you more control. Open your terminal and run:
df -h

This command shows how much space is used and how much is free on each mounted partition in a human-readable format.
The df command helps you identify which disk or partition is filling up, but it doesn’t show what is using the space. That’s where du comes in. Once you know which disk is affected, you can use du to track down the directories consuming that space. For instance, to check the size of a specific directory, run this:
du -sh /path
If you want a quick overview of all top-level directories, run:
sudo du -sh /*
One more thing, if you want something interactive in the terminal, I highly recommend checking out ncdu.

This disk usage analyzer scans your directories and presents the results in a clear, navigable interface. You can browse folders by size using your keyboard, which makes tracking down disk hogs much faster and less frustrating. You can install it using your default package manager.
Clean Temporary and Cache Files
Over time, your system quietly collects temporary files and cached data that are no longer needed. Package managers keep downloaded installation files, applications leave behind temporary data, and browsers store large caches in the background. Clearing these files is one of the easiest ways to free up disk space without affecting your system.
If you use a Debian- or Ubuntu-based system, you can clear these files by running:
sudo apt clean
If you prefer a slightly safer approach that only removes outdated packages, use:
sudo apt autoclean

For Fedora or Red Hat-based systems, you can clear the package cache with:
sudo dnf clean all
Arch users can achieve the same result with:
sudo pacman -Scc
There are also dedicated cleanup utilities like BleachBit, which provide a friendly GUI to clean package caches, system temp files, and browser caches safely.

Another place worth checking is the /tmp directory, which holds temporary files created by running programs. These files are usually cleared on reboot, so restarting your system is the safest way to clean it. If rebooting isn’t an option, you can remove the files manually with:
sudo rm -rf /tmp/*
Just make sure no critical processes are actively using those files.
Manage Log Files
Log files are essential for troubleshooting, but they can quietly grow and take up a lot of disk space if left unchecked. On modern Linux systems using systemd, the journal keeps system logs that can persist indefinitely. You can check how much space they are using with:
journalctl --disk-usage
If the size is large, you can safely reduce it by keeping only a certain amount of logs:
sudo journalctl --vacuum-size=500M
This keeps recent logs for troubleshooting while removing old ones you probably won’t need. Moreover, traditional logs live in “/var/log/”, and some files like syslog or kern.log can grow huge if something goes wrong. Instead of deleting them, you can truncate them to clear their content safely:
sudo truncate -s 0 /var/log/syslog
This keeps the file intact so services relying on it don’t break. Some Linux GUI programs like Baobab, Filelight, or BleachBit make it easy to spot large logs and remove them with a few clicks.
Remove Old or Unused Packages
Unused software and leftover dependencies quietly consume space over time, and removing these packages keeps your system lean and secure. For example, on GNOME-based systems like Ubuntu, you can open the App Center, go to the Manage tab, and browse through your applications. From there, simply select any app you no longer need and click Remove. KDE users can do the same in Discover.

Further, if you are comfortable with the terminal, then you can remove packages that are no longer required along with their configuration files. For example, for Debian-based systems, run:
sudo apt autoremove --purge

If you are on Fedora, you can run:
sudo dnf autoremove
And for Arch Linux, you can clean orphaned packages using this:
sudo pacman -Rns $(pacman -Qtdq)
This cleanup reduces clutter and keeps your system lean and easier to maintain.
Finally, don’t ignore containerized applications like Snaps and Flatpaks, which are often larger than standard packages. You can list them with snap list or flatpak list to find candidates for removal.
Find and Delete Large Files
Things like old ISO images, backup archives, database dumps, or virtual machine files can quietly take up several gigabytes each. Tools like Baobab can scan your system and visually highlight large files and directories, so you can spot space hogs quickly and decide what to delete or move.
If you’re working from the terminal or want a precise way to hunt down large files, you can use the ls, find, and du commands. These tools search your system for larger unused files and list them with their sizes. Once you spot the big files, remove them or move them to another location or external drive.
Remove Old Kernels
Linux keeps old versions of the kernel every time you update. This is a safety feature; if a new kernel breaks your audio or Wi-Fi, you can reboot into the old one. However, you rarely need more than two: the current one and the previous working one. These old kernels take up significant space and are often overlooked.
The good news is that the sudo apt autoremove command mentioned above typically handles this on modern Ubuntu systems, cleaning up the old kernels automatically. If you want to be sure, check your current kernel version using this:
uname -r
If you still intend to check all your installed kernels, use:
dpkg --list | grep linux-image

Now, manually remove specific kernel versions with:
sudo apt remove linux-image-5.4.0-42-generic
Make sure you never remove the kernel you’re currently using, as doing so can make the system unbootable. In addition, you can also use visual tools like Stacer, as they provide a simple kernel cleaner interface that lists all installed versions and lets you check boxes to remove the ones you don’t need.
Consider Moving Data to External Storage
If you have cleaned caches, logs, and packages but are still having trouble, you simply might have too much data for your drive. In this case, moving large files to external or secondary storage is a practical solution. You can then mount the external drives so they are accessible when you need them, but they won’t clog up your root partition.
Tools like rsync allow you to move data safely while preserving permissions and ownership. Plus, services like Nextcloud let you host your own cloud, keeping control of your data.
Final Thoughts
Once you’ve cleared out some space, regular monitoring is the best way to keep the disk from filling up again. You’ll spot gradual growth early and avoid sudden crises when storage runs out. You can also add a disk usage widget to your panel so you can always have a quick glance at your usage. By checking these things regularly, you can keep your system stable and responsive.
