I can’t be alone in noticing how, no matter how much storage I buy for my computer, digital refuse always piles up. Fortunately for me, on Linux, there’s a simple terminal command that let me easily drag up the heftiest files. I wasn’t too proud of the results.
Meet ncdu and Go Fishing for the Whoppers
I’ll be honest: I’m not a command line ace. If a job can get done easily and effectively in a graphical application, I’m going to do it that way.
Not every job is that way, though. I needed to figure out which files were taking up the most space on my Linux PC’s drive, and I knew checking the size of each folder in Dolphin file browser wasn’t going to cut it. I know the Linux terminal had to have a better solution.
Luckily, it does. I looked it up and found ncdu, a terminal-based application for scanning and easily finding the locations of the biggest files on your Linux drive.

Related
How to Use ncdu to Find Disk-Hogging Directories in Linux
Tame your disk space from the terminal!
Using ncdu is dead-simple: open a terminal, type in ncdu, hit Enter, and wait. It’ll scan every file in the current directory, plus its subdirectories. It includes hidden files, too, so don’t think those will be escaping our ire today.
If you want to scan specific directories, you can tell ncdu as much. For example, to scan everything in your system’s temporary files, you’d use:
ncdu /tmp
Or, to scan your entire system starting with the root folder, you’d call:
ncdu /
In my case, I’m not daring to mess with any system files. Instead, I’d rather keep my snooping limited to my home folder. Everything there will involve just my personal files rather than any mission-critical configuration files and the like.

Related
These 5 Linux Commands Make Reading Large Files Easier
Quality, not quantity.
The First Screen: A Top-Down View
Since my terminal opens to my home folder by default, I simply launch the terminal with the Ctrl+Alt+T keyboard shortcut and issue the ncdu command.
When ncdu finishes scanning, it’ll list all the folders and files in descending order, with the site of largest storage use at the top. It includes a bar graph of relative size for each folder or file, so you size up offenders at a glance.
If I decided I want to actually see the smallest files first for some reason, I can just hit the s key to toggle ascending and descending order. I can also reorder by number of items (i.e., files and subfolders) with the C key.
The ncdu interface is essentially a file browser, so navigating the folders is easy. Use either the arrow keys or, in Vim-like fashion, the h, j, k, and l keys, you can dip in and out of folders with ease. It wasn’t long before I was making a hit list of storage hogs.
Virtual Machines, Virtual Machines Everywhere
On my first effort using my Kubuntu Focus laptop, I quickly discovered that I have a problematic VM (Virtual Machine) habit. You may have noticed in an earlier screenshot that, save for the Downloads directory, most of my storage was being consumed by virtual drives where the likes of Windows 10, Linux Mint, and DietPi were living.
I use Quickemu as well Virtual Box for VMs, so these were spread all over the place. Unfortunately, I rarely feel the need to delete my precious VMs—until they become borked and unusable from my tinkering.
Downloads: The Junk Drawer of the Modern PC
We all saw it coming: the Downloads folder, where so many temporarily useful files come to rest. Some are larger than others, especially the ISO files I use to install the aforementioned virtual machines. Then there’s my Usenet newsreader’s “complete” folder, which we won’t be exploring today but I can assure is completely innocent.
Sometimes, of course, the files we collect take up space not individually but as a collective. You can also find a total number of items at the bottom of the screen. Note that this total includes everything within the subdirectories of the current directory. The further you drill down, the smaller the number becomes.
It’s difficult to read in this screenshot thanks to the unfortunate color scheme of my current terminal, but it reads “208” in my Downloads file. As the kids say, oof.
Games I Never Play
While I don’t game much on my laptop, I do sometimes play games on my tower PC running Garuda Linux. The keyword there is “sometimes,” as was revealed when I ran ncdu on that PC. The results showed, aside from, yes, yet more virtual machines, and a place I was temporarily storing a backup folder, some large games that I haven’t played in months.
Steam stores game files in the “/.local” folder, and that’s why it’s at the top of the list. Since it’s a Linux hidden file, you won’t see it normally in your graphical file browser unless you toggle that on.
Some Programs’ Vast Caches
I also found on my tower PC some hefty caches stored on behalf of Google Chrome, Spotify, and Mozilla Firefox respectively.
It makes sense, considering I use those programs quite a bit, and that they require the constant downloading of data. All the more reason, though, to make sure your next computer has more storage rather than less.
What to Do With All These Files?
When it’s time to actually start decluttering and doing away with those space hogs, ncdu gives you a simple delete command with the d key. It’ll prompt you to confirm, until you tell it to stop asking.
I found that the deletion happens immediately, and the file doesn’t go to your recycle bin, so make sure you’re confident about that file erasure.
You could also open up another terminal window and use rm to issue more powerful delete commands.
Of course, I used Steam to delete those Steam games I wasn’t planning to play anymore, and Heroic Game Launcher for the game files it created. That way, more of the files those managers across my system got automatically deleted, rather than me deleting only and individually each file I see in front of me. Chrome, Spotify, and Firefox, all have their own cache deletion tools in their settings menus, too.
If ncdu reveals you have untenable storage habits like I do, consider expanding your capacity with a reliable internal SSD drive. If you won’t be accessing the files frequently or need them fast and responsive, you could get the same storage cheaper with an internal HDD instead.

- Storage capacity
-
2TB
- Hardware Interface
-
M.2 NVMe
- Brand
-
PNY
- Transfer rate
-
3,400MB/s read and 2,700MB/s write speeds
- TBW
-
1,200
- Warranty
-
5-year
The PNY CS2230 2TB NVMe SSD is a great mid-range storage drive. Offering 2TB of speedy SSD storage, this drive takes up very little space in your system as it mounts directly to the motherboard.
Leave a Comment
Your email address will not be published. Required fields are marked *