How I Actually Check Folder Size on Linux (and What Got Me There Faster)

I’m Kayla. I spend way too much time cleaning computers. Mine. Friends. My dad’s ancient ThinkPad. You know what? Space runs out fast. Photos. Docker. Big game files. So I got picky about a simple thing: how to see folder size, fast, and without guesswork.

Here’s what I use, with real commands, and what went right (and wrong).

If you’d like an even deeper dive with some extra screenshots, I’ve posted a companion piece over on Freedom Penguin that walks through these tricks step by step.

The quick win: plain old du

When I just need the size of one folder, I go simple. This works on any Linux box I touch. For anyone who wants to master every flag and nuance, an in-depth guide to the du command lays out all its options far better than I can cram into a blog post.

Command I run:

du -sh ~/Downloads

What I saw last week:

7.2G    /home/kayla/Downloads

Short and sweet. That “-s” means summary. The “-h” means human numbers (G, M, K). Good for a quick gut check.

Side note: I’ve discovered more than once that a chunk of that space comes from stashes of high-resolution red-carpet photos and movie-star wallpapers I’d absent-mindedly saved. If you’re the type who also hoards those glossy pics, you might appreciate browsing this regularly-updated celebrity roundup that spotlights trending stars and photo sets—perfect for deciding which images are worth keeping before they swallow more gigabytes.
I also found a whole gig of selfies and ticket stubs from a spontaneous evening in Orange County; if you’re plotting your own last-minute outing and want to know what’s happening around town, the nightlife listings at One Night Affair’s Buena Park backpage can point you toward the latest events and hot spots—saving you time (and maybe a few gigabytes of random photos) when the night is over.

When I want a breakdown of the folders inside the current folder:

du -h --max-depth=1 .

Sample output from my Pictures folder:

1.3G    ./Screenshots
850M    ./iPhone
52M     ./Edits
12K     ./tmp
2.2G    .

And when I need them sorted smallest to largest:

du -h --max-depth=1 . | sort -h

I keep that one on a sticky note. It saves me every time.

One more that I run on root, to find the big stuff across the drive:

sudo du -xh --max-depth=1 / | sort -h

The “-x” flag keeps it to one disk. That skips weird mounts. My result last month:

1.1G    /opt
5.0G    /usr
8.1G    /var
15G     /home

And boom, I know where to look. If you want to see exactly how I refined this approach across different distros, I laid out the full process in my Freedom Penguin guide, How I Actually Check Folder Size on Linux (and What Got Me There Faster).

Tiny gripe: du can be slow on a huge disk. It has to walk every folder. I make tea while it runs. It’s fine.

Wait—doesn’t ls show size?

I tried. It doesn’t help here. This command:

ls -lh

It shows file sizes, not folder totals. A folder will look like “4.0K.” That’s not the real space used. So I don’t trust ls for this job.

My favorite for cleanup: ncdu (interactive and friendly)

When I need to clean fast, I use ncdu. It’s like du, but with a simple screen I can arrow through. It even deletes files if I say so. Careful fingers here. If you’re new to it, this comprehensive overview of ncdu walks through installation and every feature from top to bottom.

Install it from your package manager, then run:

sudo ncdu -x /

The “-x” keeps it from crossing to other disks. What I saw on my laptop in spring:

--- / -------------------------------------------------------------
  18.1 GiB [##########] /var
  15.2 GiB [######### ] /home
   5.0 GiB [###       ] /usr

I drilled into /var, and found Docker eating space:

/var/lib/docker  ->  14.7 GiB

I cleaned old images, and poof—14 gigs back. Felt so good. Downside? ncdu needs a terminal. I like that, but my dad does not.

Prettier text view: tree with sizes

Sometimes I want a tidy listing for notes or a report. I use tree with directory sizes.

Command:

tree -h --du -L 2 /var/log

Snip from my server:

/var/log
├── 320M [########] journal
├── 120M [###     ] nginx
└── 12M  [#       ] apt

It’s not as hands-on as ncdu, but it reads well.

When I need visuals: Disk Usage Analyzer (baobab)

On GNOME, I open “Disk Usage Analyzer.” It scans the drive and shows a big ring chart. My dad gets it at a glance. He clicked Downloads, and we found a 4.5G ISO he forgot about. He pressed Delete, and we cheered—quietly, but still.

Plus, it shows mounted disks too. That helps on messy setups.

Small catch: it can feel slow on old HDDs. But the view is worth it when you want a picture, not a list.

A modern touch: dust

I also use dust. It’s like du, but with a bar chart in the terminal. Nice and fast.

Example:

dust -d 1 ~

What it printed for me:

 15G  ████████████████████████████  /home/kayla
 12G  ████████████████████          Downloads
  2G  ████                          Pictures
600M  ██                            .cache

Great for a quick read. I still switch to ncdu when I want to delete things.

Little things that save me time

  • Permissions: du may say “Permission denied.” I add sudo, or skip locked folders.
  • Noisy system folders: I avoid scanning /proc, /sys, and /run. They’re special.
  • One disk only: I add “-x” so du or ncdu stays on one filesystem.
  • Want exact bytes? Use “-B1”:
    du -B1 -s ~/Videos
    
  • Curious why “apparent size” differs? Sparse files. Compression. If I need the raw sum of file sizes, I use:
    du -sh --apparent-size .
    
  • Ran into the dreaded “too many open files” limit while chewing through logs? I break down the fix step by step in my hands-on take.
  • Sometimes space hogs hide in dot folders—if you need a refresher on revealing them inside Nautilus or another file manager, check out my piece on showing hidden files on Ubuntu.

My go-to flow

  • Need a quick answer? du -sh FOLDER
  • Want a tidy list? du -h –max-depth=1 . | sort -h
  • Cleaning for real? ncdu -x /
  • Need a picture? Disk Usage Analyzer (baobab)
  • Want a quick glance with bars? dust

Honestly, I use all of them. Different days. Different messes. But if you made me pick only one, I’d keep ncdu. It’s saved me gigs, fast, without fuss. And yes, I still keep that little du + sort trick on a sticky note. It’s my tiny space saver.