Pages

Saturday, June 24, 2017

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.
Pydf Command to Check Disk Usage
Pydf Command to Check Disk Usage
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

# yum install pydf
Sample Output
Loaded plugins: fastestmirror, security
Determining fastest mirrors
epel/metalink        | 4.2 kB        
* base: mirror.nbrc.ac.in
* epel: mirrors.ispros.com.bd
* extras: mirror.nbrc.ac.in
base                                                                    | 3.7 kB         
epel                                                                    | 3.9 kB       
epel/primary_db                                                         | 4.2 MB        
extras                                                                  | 3.5 kB        
updates                                                                 | 3.5 kB     
updates/primary_db                                                      | 1.9 MB     
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
Is this ok [y/N]: y
Downloading Packages:
pydf-9-3.el6.noarch.rpm                                                 |  14 kB        
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : pydf-9-3.el6.noarch                                          1/1 
Verifying  : pydf-9-3.el6.noarch                                          1/1 
Installed:
pydf.noarch 0:9-3.el6                                                                                                                                   
Complete!

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.
$ sudo apt-get install pydf
Sample Output
[sudo] password for tecmint: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
java-wrappers
Use 'apt-get autoremove' to remove it.
The following NEW packages will be installed:
pydf
0 upgraded, 1 newly installed, 0 to remove and 10 not upgraded.
Need to get 12.1 kB of archives.
After this operation, 70.7 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu/ raring/universe pydf all 10 [12.1 kB]
Fetched 12.1 kB in 1s (6,097 B/s)
Selecting previously unselected package pydf.
(Reading database ... 175568 files and directories currently installed.)
Unpacking pydf (from .../apt/archives/pydf_10_all.deb) ...
Processing triggers for man-db ...
Setting up pydf (10) ...

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.
# pydf
Filesystem Size  Used Avail Use%                                            Mounted on
/dev/sda2   49G 3244M   44G  6.4 [###.....................................] /         
/dev/sda1  194M   43M  140M 22.4 [#########...............................] /boot     
/dev/sdb1  492G  345G  122G 70.2 [#########################...............] /data    
/dev/sda3   39G 4043M   33G 10.0 [####....................................] /home     
/dev/sda6   55G   33G   19G 60.0 [########################................] /var      
/dev/sdc1  492G  262G  205G 53.3 [#####################...................] /videos
To check which file system having 0 blocks, simple run the following command along with “-a” or “–all” argument.


      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
                                                    ► Read more: http://adf.ly/1n7SwG

      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

No comments:

Post a Comment