Quantcast
Channel: LinuxNov » Shell CLI
Viewing all articles
Browse latest Browse all 12

df Command For Showing System Disk Space #CLI

$
0
0

df “Disk Free” is a command line program used to display the amount of free and used disk spaces for the mounted file systems.

By using df command without adding any options for the command it will display the disk space amount for the file systems in “Bytes” units which is quite difficult to identify the mount of free and used disk spaces. So, we will go through some options for df command which will report the disk spaces in different formats.

Open Terminal and type,

df

This is the default command without any options or arguments, which will display currently mounted file systems along with total space, free space, used space, and mounting directory.

df-disk-space-command-line-CLI

Human Readable Units

df -h

“Human Readable” This print the output with easier and readable unit sizes such as GB, MB, and KB. The default command without “-h” command shows the file systems with Bytes unit.

df-disk-space-human-readable-option-command-line-CLI

Block Sizes

Block size option allows you to scale the disk spaces with different unit arguments such as:

df -B MB

df-disk-space-Without-Scale-option-MB-command-line-CLI

Here’s using the block size option with “MB” Megabytes argument which will print the full disk space without scaling. But, if we need to scale it by 2 ” Divide the disk space by 2 “, we will use the following command.

df -B 2MB

df-disk-space-Scale-option-MB-command-line-CLI

Bock sizes using GB “Gigabytes”

df -B GB

Display a specific file system type such as Ext4, Ext3, NTFS, …etc.

For NTFS file system

I tried to the NTFS file system for df command to print the disk space for it, but it didn’t work. After searching for the right argument for NTFS file system, I found that NTFS is reported as “fuseblk” which is mounted using NTFS-3G. So, if we would like to display disk space for the NTFS file system we will use the following command.

df -h -t fuseblk

For Ext4 file system

df -h -t ext4

df-disk-space-command-line-CLI-NTFS-Ext4-filesystem-types

You could use df command in Conky system monitor software to display the free disk space for your file systems.

Also check the manual page for df command using the follow command.

man df

df command.


Viewing all articles
Browse latest Browse all 12

Trending Articles