Ctrl K

Check Disk Usage and Storage

Check disk and partition usage, see the disk layout and filesystem types, and find which folders are consuming space with df, lsblk, du, and ncdu.

Find out whether a disk is full, what partitions exist, and which folders are using the space. df answers "is the disk full", lsblk answers "what disks and partitions exist", du answers "which folders use the space", and ncdu lets you browse usage interactively.

Quick reference

# is the disk full
df -h

# disks, partitions, filesystem types, and mount points
lsblk -f

# biggest folders in home, largest first
du -h --max-depth=1 ~ | sort -hr

# total size of one folder
du -sh "$HOME/projects"

# interactive disk usage browser
ncdu ~

Check disk and partition usage

df (disk free) lists mounted filesystems with size, used, available, and percent used. The key row is the one mounted on /, the root filesystem: if it is near full the system disk is near full. As a rule of thumb, investigate when / is above about 80 percent.

df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p2  500G  180G  320G  37% /
/dev/nvme0n1p1  1.0G  300M  700M  30% /boot

See disks and partitions

lsblk (list block devices) shows disks, SSDs, NVMe and USB drives, and their partitions as a tree. Add -f to also show filesystem type, label, UUID, and mount point, which is what you usually want.

lsblk -f
NAME        FSTYPE FSVER LABEL UUID            MOUNTPOINT
nvme0n1
├─nvme0n1p1 vfat   FAT32       XXXX-XXXX       /boot
└─nvme0n1p2 ext4   1.0         xxxxxxxx-...    /

Use this to see which partition is root (/), which is boot (/boot), and the filesystem type of each.

FilesystemTypical role
ext4Common Linux root filesystem
btrfsModern Linux filesystem with snapshots and subvolumes
vfatEFI boot partition
swapSwap partition or area

Find which folders use space

du (disk usage) reports folder sizes. --max-depth=1 keeps it to one level so you see the immediate subfolders, not every nested file. Pipe to sort -hr to order largest first (-h sorts human-readable sizes correctly, -r reverses).

# subfolders of the current directory
du -h --max-depth=1

# subfolders of home, largest first
du -h --max-depth=1 ~ | sort -hr
30G     /home/user
20G     /home/user/projects
3.5G    /home/user/downloads
1.2G    /home/user/.cache
500M    /home/user/.config

When you only care about one folder, -s summarizes it to a single total.

du -sh "$HOME/projects"

Browse usage interactively with ncdu

ncdu is an interactive disk usage browser. It scans a directory once, then lets you move into the largest folders to find what is taking space, which is usually faster than repeated du calls.

# Arch
sudo pacman -S ncdu

# Ubuntu/Debian
sudo apt install ncdu

ncdu ~

Inside ncdu: arrow keys move, Enter opens a folder, Backspace goes back, d deletes the selected entry, q quits. Be careful with d, it deletes immediately.

Typical workflow

  1. df -h to check whether / is near full.
  2. lsblk -f to confirm the disk and partition layout.
  3. du -h --max-depth=1 ~ | sort -hr to find the largest home folders.
  4. Repeat du on a large folder, for example du -h --max-depth=1 "$HOME/projects" | sort -hr.
  5. ncdu ~ when manual scanning is not enough.

Mental model

CommandAnswers
dfIs my disk or partition full?
lsblkWhat disks and partitions do I have?
lsblk -fWhat filesystem and mount point does each partition have?
duWhich folders are using the space?
ncduLet me browse storage usage interactively.