If you are a Linux Command Line user, you will certainly use the df command to check the disk usage of the file system. Although df is a popular command, it still cannot provide some advanced functions, such as a user's actual disk space and various useful display formats. Another command line utility is available, which not only provides these advanced features but also provides all the features of df. In this article, we will discuss the disk information tool-di
Note-for more information about df, see the df command tutorial.
Di-disk information tool
From this di help manual page, it is obvious that di provides some valuable features and is worth a try. Let's take a look at some examples of the actual use of this tool.
Test Environment
- OS-Ubuntu 13.04
- Shell-Bash 4.2.45
- Application-di 4.30
A short tutorial
Below are some examples of di tools:
1. Default output
By default, di commands generate readable output formats
Here is an example:
$ Di
Filesystem Mount Size Used Avail % Used fs Type
/Dev/sda6/28.1G 20.2G 6.5G 77% ext4
Udev/dev 1.5G 0.0G 1.5G 0% devtmpfs
Tmpfs/run 300.2 M 0.9 M 299.3 M 0% tmpfs
Therefore, you can find the data units that use gigabytes (GB) and megabytes (MB) for disk usage. This is definitely better than the default output of df. (: Df can also output a display with a similar unit, but an additional parameter-h is required)
2. Use the-A option to print all fields such as Mount Points and special device names
Option-A can be used to print detailed mount points and special device names.
Here is an example:
$ Di-
Mount fs Type Filesystem
Options
Size Used Free % Used % Free
Size Used Avail % Used % Free
Size Used Avail % Used
Inodes Iused Ifree % Iused
/Ext4/dev/sda6
Rw, errors = remount-ro
28.1G 20.2G 8.0G 72% 28%
28.1G 21.6G 6.5G 77% 23%
26.7G 20.2G 6.5G 75%
1884160 389881 1494279 21%
/Dev devtmpfs udev
Rw, mode = 0755
1.5G 0.0G 1.5G 0% 100%
1.5G 0.0G 1.5G 0% 100%
1.5G 0.0G 1.5G 0%
381805 571 381234 0%
/Run tmpfs
Rw, noexec, nosuid, size = 10%, mode = 0755
300.2 M 0.9 M 299.3 M 0% 100%
300.2 M 0.9 M 299.3 M 0% 100%
300.2 M 0.9 M 299.3 M 0%
384191 549 383642 0%
So you can see all the fields and print the output for debugging purposes.
3. Use the-a option to print all mounted devices
Here is an example:
$ Di-
Filesystem Mount Size Used Avail % Used fs Type
/Dev/sda6/28.1G 20.2G 6.5G 77% ext4
Udev/dev 1.5G 0.0G 1.5G 0% devtmpfs
Devpts/dev/pts 0.0 M 0.0 M 0.0 M 0% devpts
Proc/proc 0.0 M 0.0 M 0.0 M 0% proc
Binfmt_misc/proc/sys/fs/bi 0.0 M 0.0 M 0.0 M 0% binfmt_misc
Tmpfs/run 300.2 M 0.9 M 299.3 M 0% tmpfs
None/run/lock 0.0 M 0.0 M 0.0 M 0% tmpfs
None/run/shm 0.0 M 0.0 M 0.0 M 0% tmpfs
None/run/user 0.0 M 0.0 M 0.0 M 0% tmpfs
Gvfsd-fuse/run/user/himan 0.0 M 0.0 M 0.0 M 0% fuse. gvfsd-fuse
Sysfs/sys 0.0 M 0.0 M 0.0 M 0% sysfs
None/sys/fs/cgroup 0.0 M 0.0 M 0.0 M 0% tmpfs
None/sys/fs/fuse/co 0.0 M 0.0 M 0.0 M 0% fusectl
None/sys/kernel/deb 0.0 M 0.0 M 0.0 M 0% debugfs
None/sys/kernel/sec 0.0 M 0.0 M 0.0 M 0% securityfs
So you can see all the information related to all devices, which is printed out.
For more details, please continue to read the highlights on the next page:
Recommended reading:
Linux Command cd
Cat for Linux commands
Linux Command alias/unalias
Linux Command Parsing: su root and su-root
Interactive input of Linux commands read
File Processing commands for Linux commands