How to Check How Much Free Space You Have on Linux from the Terminal
With df and du, and which folders are taking up the most space.
Space per disk/partition
df -h
The -h (human-readable) option shows sizes in readable
GB/MB, instead of exact bytes that are hard to read.
Which folders take up the most space
du -sh /home/* | sort -rh | head -10
Lists the 10 folders taking up the most space inside your home folder, sorted from largest to smallest — useful for quickly finding what's eating up your space.
Tip: if du takes a while on a very
large folder, be patient — it's going through every file to calculate
the real size, that's not a fault, just an exhaustive calculation.
Frequently asked questions
What's the difference between df and du?
df shows the total space of each disk or partition. du calculates the real size of specific files and folders — they're complementary, not the same thing.