df - show disk space usage

df df command

df command is a basic Unix command for getting information about disk space usage on your system. It typically shows the following information:

  • storage device
  • filesystem (mount point)
  • filesystem size
  • storage used
  • available storage
  • percentage of use

Getting disk space usage information

Used without any parameters, df command shows you disk space usage in bytes (speficially, 1K-blocks):

greys@server:~ $ df
Filesystem                  1K-blocks     Used Available Use% Mounted on
tmpfs                          195248     1768    193480   1% /run
/dev/mapper/ubuntu--vg-root  28348196 23418296   3464556  88% /
tmpfs                          976228        0    976228   0% /dev/shm
tmpfs                            5120        4      5116   1% /run/lock
/dev/mmcblk1p1                 523248      392    522856   1% /boot/efi
newvol                        1339008   221056   1117952  17% /newvol
tmpfs                          195244       72    195172   1% /run/user/1000

I tend to use -h parameter to get human-readable output:

greys@server:~ $ df -h
Filesystem                   Size  Used Avail Use% Mounted on
tmpfs                        191M  1.8M  189M   1% /run
/dev/mapper/ubuntu--vg-root   28G   23G  3.4G  88% /
tmpfs                        954M     0  954M   0% /dev/shm
tmpfs                        5.0M  4.0K  5.0M   1% /run/lock
/dev/mmcblk1p1               511M  392K  511M   1% /boot/efi
newvol                       1.3G  216M  1.1G  17% /newvol
tmpfs                        191M   72K  191M   1% /run/user/1000

Showing inodes Usage with df

inodes is a pretty advanced concept, so I’ll dedicate a separate article to it. But you should know that df command shows you inodes usage as well:

Filesystem                  Inodes IUsed IFree IUse% Mounted on
tmpfs                         239K  1.1K  238K    1% /run
/dev/mapper/ubuntu--vg-root   1.8M  448K  1.3M   26% /
tmpfs                         239K     1  239K    1% /dev/shm
tmpfs                         239K     5  239K    1% /run/lock
/dev/mmcblk1p1                   0     0     0     - /boot/efi
newvol                        2.2M    62  2.2M    1% /newvol
tmpfs                          48K    69   48K    1% /run/user/1000

See also




Contact Me

Follow me on Facebook, Twitter or Telegram:
Recommended
I learn with Educative: Educative
IT Consultancy
I'm a principal consultant with Tech Stack Solutions. I help with cloud architectrure, AWS deployments and automated management of Unix/Linux infrastructure. Get in touch!
Recent Articles
03 Sep 2024

macOS Sequoia 15.0

02 Sep 2024

Video: Has This Worked Before?

24 Mar 2024

Homelab: Mac Pro 2013 32GB

Recent Tweets