Table of Contents

Disk Usage

Show the Disk Usage

  df -h

File System Usage

Show the current file system usage of each subdirectory of the root directory

  du -hs /*

Show file system usage of the current directory

  du -hs ./*

When They Don't Match

When the df and du commands return different results, lsof is your friend!

Sometimes, files get ‘unlinked’ from the filesystem. They could have been deleted but held open by a process. You can find them by typing

sudo lsof | grep deleted

or perhaps

sudo lsof | grep DEL

Sometimes you can find a process is holding onto a file so you can kill it, or try a reboot.