Duviz – managing the free hard disk space on Linux

D

We already talked about FlameGraphs, a graphical tool for finding out free hard disk space in Linux. Today I will present duviz.py, a simple utility in the command-line, written in Python, which allows you to view the space used in Linux distributions.

Characteristics

• Basically, you only need Python2, du and ls, for installing it, which are in any Linux distribution.
• It has only one file – the Python-written duviz.py script. It can be put anywhere and run anywhere.
• It is fast. It does not require waiting time to open the graphical interface.
• Duviz detects the size of the terminal so that the output will be adapted to its width.
• It does not need arguments. The simple run script displays the size of the directory in which it is located.
• It has a framework for inode counting instead of files: you have to add -i or –inodes to the command you will enter.

Installation

You just have to download the file from the Github page! There is only one file!

Running the script

The script runs from anywhere, using one of the two options in the command line:

python2 duviz.py

Or we change it to executable:

<

p style=”text-align: justify;”>chmod +x duviz.py
./duviz.py

If we run it without any argument from where we downloaded it, the script will calculate and display the size of the directory where it is located. We can point to a specific directory (as in the example above):

./duviz.py /opt

Another very simple way to run it without having to remember yourself where you put it: copy (or move) the script to one of the $PATH folders (make sure it is turned to executable) and then it can be run from any address where you just have to write the command:

duviz.py [path_folder]

In the command below you can see the content of the $PATH variable environment where I chose to move the script to the /usr/bin directory:

$ echo $PATH

/usr/sbin:/sbin:/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

$ sudo mv duviz.py /usr/bin

Do not forget about the -i or –inode option.

More information can be found by running the script with the –help option.

Recent Posts

Archives

Categories