There are multitude of applications available to view as well as visualize disk usage in Linux. We already have looked at du, Ncdu, Agedu, Filelight, Duc and a few good alternatives to du command. Today we will discuss about yet another tool named Vizex to visualize disk space usage in Linux.
Table of Contents
What is Vizex?
Vizex is a command line program to display disk usage for all partitions and media in a nice graphical layout. The output of Vizex shows the total size, total used space, free space and percentage of used space of each partition in a horizontal bar chart-like diagrams.
We can customize the output as per our liking using various options. For example, we can display the visualized disk usage of a specific path. We can exclude specific partition details from the output. We can save the partitions full information in a csv
or json
file. It is even possible to display the battery information of a Laptop using Vizex.
Additionally, Vizex has a feature to print the directory contents with size, file types, and last modified date.
Vizex is written in Python language and its source code is freely available in GitHub.
Install Vizex in Linux
Vizex requires Python >= 3.7 and the Pip package manager. Make sure you have installed them on your Linux machine. If Pip is not installed yet, refer the following guide:
After installing pip, run the following command to install Vizex on your Linux system:
$ pip install vizex
To upgrade Vizex, run:
$ pip install vizex --upgrade
Vizex is available in AUR, so the Arch Linux users can install Vizex using any AUR helper programs like Yay.
$ yay -S vizex
Visualize Disk Space Usage With Vizex In Linux
Run Vizex without any options to display disk space usage in graphical format:
$ vizex
Sample output:
root Total: 68.4 gb Used: 17.2 gb Free: 47.7 gb █████████▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 26.5% used Total: 68.4 gb Used: 17.2 gb Free: 47.7 gb █████████▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 26.5% used usr Total: 68.4 gb Used: 17.2 gb Free: 47.7 gb █████████▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 26.5% used var Total: 68.4 gb Used: 17.2 gb Free: 47.7 gb █████████▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 26.5% used boot Total: 975.9 mb Used: 95.1 mb Free: 813.6 mb ███▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 10.5% used home Total: 218.8 gb Used: 113.2 gb Free: 94.5 gb ███████████████████▒░░░░░░░░░░░░░░░░░░░ 54.5% used 3968763a-adde-46e0-ae93-e2a1e51120da Total: 457.4 gb Used: 387.9 gb Free: 46.2 gb ████████████████████████████████▒░░░░░░ 89.3% used
As you can in the above output, the disk space usage is neatly displayed in a bar chart-like graphical diagram. Each graph shows the details individual partition details such as total size, remaining space, free space and the percentage of used space.
If you want additional details like filesystem type and mount point of each partition, use --details
option:
$ vizex --details
Sample output:
root Total: 68.4 gb Used: 17.2 gb Free: 47.7 gb █████████▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 26.5% used fstype=ext4 mountpoint=/ Total: 68.4 gb Used: 17.2 gb Free: 47.7 gb █████████▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 26.5% used fstype=ext4 mountpoint=/ usr Total: 68.4 gb Used: 17.2 gb Free: 47.7 gb █████████▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 26.5% used fstype=ext4 mountpoint=/usr var Total: 68.4 gb Used: 17.2 gb Free: 47.7 gb █████████▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 26.5% used fstype=ext4 mountpoint=/var boot Total: 975.9 mb Used: 95.1 mb Free: 813.6 mb ███▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 10.5% used fstype=ext4 mountpoint=/boot home Total: 218.8 gb Used: 113.9 gb Free: 93.7 gb ███████████████████▒░░░░░░░░░░░░░░░░░░░ 54.9% used fstype=ext4 mountpoint=/var/home 3968763a-adde-46e0-ae93-e2a1e51120da Total: 457.4 gb Used: 387.9 gb Free: 46.2 gb ████████████████████████████████▒░░░░░░ 89.3% used fstype=ext4 mountpoint=/run/media/sk/3968763a-adde-46e0-ae93-e2a1e51120da
Visualize specific path
By default, Vizex displays the disk usage details of all partitions. You can also display disk usage stats of a specific path:
$ vizex --path /var/home/sk/
Sample output:
/var/home/sk/ Total: 218.8 gb Used: 113.9 gb Free: 93.7 gb ███████████████████▒░░░░░░░░░░░░░░░░░░░ 54.9% used
Save disk usage details in a file
Vizex has an option to save the disk usage details in either csv
or json
file.
$ vizex --save "~/ostechnix/disk_info.json"
Customize vizex output
As stated already, we can customize the output of Vizex as per our wish. For instance, you can change the text color with -t
, --text
flag, header color with -d
, --header
flag, and graph color with -g
, --graph
flag:
$ vizex -d white -t red -g blue
Display battery usage
Even though the main goal of Vizex is to display the disk usage, the author has added an additional feature to display the battery usage. It will not display any technical details about the battery. It just displays the battery usage details.
$ vizex battery
Sample output:
Battery ██████████████████████████████████████▒ 100.0% Plugged in: False Discharging: 2:48:10
Display directory and file information using vizexdf
Vizex has a sub command named vizexdf
that displays directories and files information in a tabular form.
We can
To print current directory data using vizexdf, run:
$ vizexdf -ads name
The above command will list the contents of current directory along with the size of each directory and file, file types and last modification time.
Here, -a
flag is used to display all files including hidden files, -d
flag is used to list the contents in descending order, and -s
flag is used to sort contents based on name, file type, size, or date. The above command print current directory data including hidden files and folders, sorted by name and in descending order.
Similarly, we can print current directory data sorted by size using this command:
$ vizexdf -ads size
Print current directory data sorted by last modified time:
$ vizexdf -ads dt
In all of the above examples, we displayed the contents of current directory. If you want to display the details of a specific directory, for example ~/Downloads
, just mention its path:
$ vizexdf ~/Downloads
For more details, refer he help section of vizex and vizexdf commands:
$ man vizex
$ man vizexdf
Resource: