Master Linux Disk Monitoring: df, pydf, fdisk & sfdisk Commands Explained
This guide walks through essential Linux command‑line utilities—df, pydf, fdisk and sfdisk—showing how to display disk usage, list partitions, and query specific devices, with installation tips, example outputs, and practical options for clear monitoring.
df command
The df utility reports file‑system disk usage. Using the -hT options displays size, used space, available space, usage percentage, file‑system type, and mount point in a human‑readable format.
[root@localhost ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 898M 0 898M 0% /dev
tmpfs tmpfs 910M 0 910M 0% /dev/shm
tmpfs tmpfs 910M 29M 881M 4% /run
tmpfs tmpfs 910M 0 910M 0% /sys/fs/cgroup
/dev/mapper/centos-root xfs 37G 1.6G 36G 5% /
/dev/sda1 xfs 1014M 150M 865M 15% /boot
tmpfs tmpfs 182M 0 182M 0% /run/user/0pydf command
pydf is a Python‑based alternative to df that adds colour‑coded output. It is not included by default in CentOS 7/RHEL 7; install it via pip (or apt on Ubuntu).
# Install pip on CentOS/RHEL
[root@localhost ~]# yum -y install python-pip
# Upgrade pip
[root@localhost ~]# pip install --upgrade pip
# Install pydf
[root@localhost ~]# pip install pydfOn Ubuntu: $ sudo apt install pydf Display all file systems:
[root@localhost ~]# pydf -aShow usage in a human‑readable format:
[root@localhost ~]# pydf -h
Filesystem Size Used Avail Use% Mounted on
/dev/centos/root 37G 1624M 35G 4.3 [#.....................] /
/dev/sda1 1014M 149M 865M 14.7 [###...................] /bootfdisk command
fdisk is a classic Linux utility for partition management. The -l option lists all partitions and their device names.
[root@localhost ~]# fdisk -lTo view details of a specific disk, supply the device name after -l (e.g., fdisk -l /dev/sda).
sfdisk command
sfdisk offers scriptable partitioning similar to fdisk but can display sizes in megabytes using the -uM option.
[root@localhost ~]# sfdisk -l -uMSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
