The pydf command displays the amount of used and available space on your file systems, just like df command, but in colors. The output format is completely customizable.
This is a little known tool (python script) that displays the amount of disk space available on the mounted filesystems, using different colours for different types of filesystems.
Install pydf
Use the apt-get command to install pydf under Debian / Ubuntu Linux:
$ sudo apt-get install pydf
Sample outputs:
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: pydf 0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded. Need to get 13.3 kB of archives. After this operation, 45.1 kB of additional disk space will be used. Get:1 http://debian.osuosl.org/debian/ squeeze/main pydf all 9 [13.3 kB] Fetched 13.3 kB in 0s (13.5 kB/s) Selecting previously deselected package pydf. (Reading database ... 224818 files and directories currently installed.) Unpacking pydf (from .../apt/archives/pydf_9_all.deb) ... Processing triggers for man-db ... Setting up pydf (9) ...
RHEL / CentOS / Fedora Linux users, use the yum command to install pydf (first enable EPEL repo as described here):
# yum -y install pydf
Sample outputs
Loaded plugins: product-id, protectbase, rhnplugin, subscription-manager Updating certificate-based repositories. 0 packages excluded due to repository protections Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package pydf.noarch 0:9-3.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ========================================================================= Package Arch Version Repository Size ========================================================================= Installing: pydf noarch 9-3.el6 epel 14 k Transaction Summary ========================================================================= Install 1 Package(s) Total download size: 14 k Installed size: 25 k Downloading Packages: pydf-9-3.el6.noarch.rpm | 14 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : pydf-9-3.el6.noarch 1/1 Installed products updated. Installed: pydf.noarch 0:9-3.el6 Complete!
FreeBSD user can use the port as follows:
# cd /usr/ports/sysutils/pydf/ && make install clean
Or, add the package using the pkg_add command:
# pkg_add -r pydf
How do I use pydf?
Simply type the command as follows:
$ pydf
Sample outputs:
To see filesystems having 0 blocks, enter:
$ pydf -aSample outputs:
To see human readable output i.e. show sizes in human readable format (e.g., 133K 2341M 2448G), enter:
$ pydf -hThe following option is same as -h, but use powers of 1000 not 1024:
$ pydf -HTo see information about inodes instead of blocks, enter:
$ pydf -iDisable colourised output i.e. do not use colours:
$ pydf --bwSee quick demon of pydf command:
(Video 01: pydf command in action)
How do I customize pydf command colors?
Edit a file called /etc/pydfrc which is act as system wide main configuration file:
# vi /etc/pydfrc
You can use per-user configuration file ~/.pydfrc:
$ cp /etc/pydfrc ~/.pydfrc
$ vi ~/.pydfrc
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop





![Sending Email With Attachments From Unix / Linux Command [ Shell Prompt ]](http://s13.cyberciti.org/images/shared/rp/3/13.jpg)










{ 11 comments… read them below or add one }
Sweet little command, didn’t know about this one. Thanks for the post!
You should mention NCDU, which i love most!
Nice little command that does one thing and does it well. Thanks.
it’s good to know about different thing thanks…
Hi, the prints are diffrent like below;
[root@linux tmp]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 28G 3.3G 23G 13% / /dev/sda1 99M 13M 82M 14% /boot tmpfs 502M 0 502M 0% /dev/shm [root@linux tmp]# [root@linux tmp]# [root@linux tmp]# pydf -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 27G 3302M 22G 11.9 [####...............................] / /dev/sda1 99M 12M 81M 12.6 [####...............................] /boot [root@linux tmp]# [root@linux tmp]# [root@linux tmp]# pydf -H Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 29G 3462M 24G 11.9 [####...............................] / /dev/sda1 104M 13M 85M 12.6 [####...............................] /boot [root@linux tmp]#Nic little tool, thanks.
Is there also something like “pydu” or “kdirstat” for comand line?
pydf is not a standard command; not all Linux distros have it.
It is available from http://kassiopeia.juls.savba.sk/~garabik/software/pydf/.
I dislike the so-called “human-readable” format (it’s really “lossy abbreviation”), and pydf has nothing else. The best way of presenting large numbers is with thousands separators. That way the numbers themselves provide a graphic representation of their relative sizes while still being human readable. I wrote this wrapper for df:
http://cfajohnson.com/shell/scripts/dfc-sh
Tried installing pydf on FreeBSD 9 and found I had to alter the shebang line of the python script to get it to work properly. The script (/usr/local/bin/pydf) installs with
#!/usr/bin/python
and this needs to be changed to:
#!/usr/local/bin/python
Works well once adjusted.
Nice tool. Thanks.
Very recently, I wrote a tool in C that displays space usage using graphs and colors. It has also other capabilities such as html and TeX export of the data. Have a look at the wiki page for some screenshots and information.
Works on Linux, *BSD and OSX and is already in FreeBSD and OpenBSD ports and packaged in some Linux distro as well (Mageia, Debian, Gentoo,…).
You might want to give it a go. ;)