Check Your Disk Space Use With The Linux DF Command
Check Your Disk Space Use With The Linux DF Command
Linux
https://w w w .redhat.com/en/blog/linux-df-command 1/24
11/21/24, 6:46 PM Check your disk space use w ith the Linux df command
SHARE
df [OPTION]... [FILE]...
$ df
Filesystem 1K-blocks Used Available Us
devtmpfs 883500 0 883500 0
tmpfs 913840 168 913672
tmpfs 913840 9704 904136
tmpfs 913840 0 913840 0
/dev/map[...] 17811456 7193312 10618144 4
$ df -h
Filesystem Size Used Avail Use% Mounted o
devtmpfs 863M 0 863M 0% /dev
tmpfs 893M 168K 893M 1% /dev/shm
tmpfs 893M 9.5M 883M 2% /run
tmpfs 893M 0 893M 0% /sys/fs
https://w w w .redhat.com/en/blog/linux-df-command 5/24
11/21/24, 6:46 PM Check your disk space use w ith the Linux df command
Get inodes
To show inode (or index node) use on each mounted
filesystem, use --inodes ( -i for short):
$ df -ih
Filesystem Inodes IUsed IFree IUse% Mount
devtmpfs 216K 393 216K 1% /dev
$ df -h --total
Filesystem Size Used Avail Use% Mounted
devtmpfs 863M 0 863M 0% /dev
tmpfs 893M 168K 893M 1% /dev/shm
tmpfs 893M 9.5M 883M 2% /run
tmpfs 893M 0 893M 0% /sys/fs
/dev/map[...] 17G 6.9G 11G 41% /
/dev/sda1 1014M 255M 760M 26% /boot
https://w w w .redhat.com/en/blog/linux-df-command 8/24
11/21/24, 6:46 PM Check your disk space use w ith the Linux df command
If you want to omit all mount points except for the total,
use grep alongside a regular expression with ^ to search
for the total at the start of a line:
$ df -h --total|grep ^total
total 22G 7.2G 15G 33% -
$ df -h /
Filesystem Size Used Avail U
/dev/mapper/centos-stream 17G 6.9G 11G 4
$ df -h /boot
Filesystem Size Used Avail Use% Mounted
/dev/sda1 1014M 255M 760M 26% /boot
$ df -h --output=source,avail,pcent,target
Filesystem Avail Use% Mounted on
devtmpfs 863M 0% /dev
tmpfs 893M 1% /dev/shm
tmpfs 883M 2% /run
tmpfs 893M 0% /sys/fs/cgroup
/dev/map[...] 11G 41% /
You can read about the available field options on the info
page and the man page.
Use df
It's a good idea to use the df command regularly to
monitor usage on critical mount points. These are the
Evans Amoany
I work as Unix/Linux
Administrator with a passion for
high availability systems and
clusters. I am a student of
https://w w w .redhat.com/en/blog/linux-df-command 13/24
11/21/24, 6:46 PM Check your disk space use w ith the Linux df command
BLOG POST
BLOG POST
ORIGINAL SHOWS
ORIGINAL SHOWS
Keep exploring
E-book: Managing infrastructure at cloud scale
E-book: Build an efficient IT foundation for
modern business success
Free trial: Red Hat Learning Subscription
Automation Artificial
intelligence
The latest on
IT automation Updates on
for tech, the platforms
teams, and that free
environments customers to
run AI
workloads
anywhere
Open Security
hybrid
The latest on
cloud
how we reduce
Explore how risks across
we build a environments
more flexible and
future with technologies
Infrastructure
hybrid cloud
The latest on
the world’s
leading
enterprise
Linux platform
Edge
computing
Updates on
the platforms
that simplify
operations at
the edge
Applications Original
shows
Inside our
solutions to Entertaining
the toughest stories from
the makers
https://w w w .redhat.com/en/blog/linux-df-command 21/24
11/21/24, 6:46 PM Check your disk space use w ith the Linux df command