Pydf an Alternative df Command to Check Disk Usage in Different Colours

The “pydf” (Python Disk File System) is an advanced command line tool and a good alternative to Linux “df comand”. It is used to display the amount of used and available disk space on a Linux file systems, same like df command, but in different colours. The output of the pydf command can be customizable according to your needs.

df Command

This “pydf” command is written in python language that displays the amount of disk usage and available space on Linux mounted file system, using custom colours for different file system types.

Installing pydf

By default, pydf tool is not installed on Linux distributions, you need to install it using third party repository. So, first enable EPEL repository and afterwards enabling it, use the following “yum command” to install it.

On RHEL/CentOS/Fedora/Scientific Linux

Sample Output

On Debian/Ubuntu/Linux Mint

On Debian based distributions, the pydf tool is availabe from package manager system, you can install it using “apt-get command” as shown below.

Sample Output

How to Use pydf Command

If you run only “pydf” command without specifying argument, it will display just information of disk space usage along with all mounted file systems.

To check which file system having 0 blocks, simple run the following command along with “-a” or “–all” argument.

To see the output in human readable format, use the option “-h”, which will print sizes (e.g., 10K10M10G).

To print sizes in kilobytes (e.g., 1024 block size) use option “-k” as shown below.

To print summary output in megabytes (e.g., 1048576 block size) use option “-m” as shown below.

To print sizes in gigabytes (e.g., 1073741824), specify option “-g” as shown below.

To see the information about inodes instead of blocks, use the argument “-i” as given below.

If you want to disable colourised output, simply use the option “–bw“.

How to Customize pydf Colours

The pydf has its own configuration file, where you can define your own custom colours to give some extra feel and look to your output.

For more information read man pages of pydf command by hitting “man pydf” in a terminal.

Leave a Reply