Pydf – Check disk space usage with colored output
Pydf is a command-line-based tool that shows the amount of disk space available on the mounted file system. This tool is similar to the df command, but pydf command gives output in different colors for different file systems.pydf tool is highly customizable, and this tool is written in the python language.
Installation of Pydf
Now let’s see how to install the pydf on the Linux systems. The pydf tool is written in the python language, hence it is also available as a python package we can install the pydf using the pip python package manager. To install the pydf using the pip, use the following command:
pip install pydf
Now let’s see how to install the pydf using package managers of different distros of Linux. Use the following command to install pydf according to your installed operating system:
For Ubuntu/Kali Linux/Debian:
sudo apt-get install pydf
For Arch Linux:
sudo pacman -S pydf
dnf install pydf
To use the pydf just run the pydf command which will show the size of the mounted file system with used, available space, and mounted location of the file system.
To show the file system having 0 blocks in the output use the -a or -all option with the pydf command:
To show the output in human-readable format i.e. in KB, MB or GB use the option -h with pydf command:
To show the output in the kilobytes, use the option -k with pydf command:
To show the information of inodes instead of block, use the -i or –inodes option with pydf command:
To show the output in megabytes use the -m or –megabytes option with the pydf command:
To show the output in the gigabytes, use the use -g or –gigabytes option with the pydf command:
To disable colorized output use the –bw option with pydf command:
Customizing the color of pydf output
Pydf provides /etc/pydfrc file to configure the output of the pydf . To customize the output of the pydf edit the /etc/pydfrc file with an editor
sudo nano /etc/pydfrc
To configure pydf at the user level, create the .pydfrc file in the home directory of the user and put the configurations in the file.
cat /etc/pydfrc > ~/.pydfrc
To know more about the pydf tool, read the man page of pydf .