Skip to content

Check Disk Usage and Storage

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.

Terminal window
# 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 ~

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.

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

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.

Terminal window
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.

Filesystem Typical role
ext4 Common Linux root filesystem
btrfs Modern Linux filesystem with snapshots and subvolumes
vfat EFI boot partition
swap Swap partition or area

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).

Terminal window
# 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.

Terminal window
du -sh "$HOME/projects"

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.

Terminal window
# 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.

  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.
Command Answers
df Is my disk or partition full?
lsblk What disks and partitions do I have?
lsblk -f What filesystem and mount point does each partition have?
du Which folders are using the space?
ncdu Let me browse storage usage interactively.