Linux-komennot

Linux df Command

Linux df Command

The “df” is a standard command in Linux, and Unix-like systems termed “Disk Filesystem.” It is used to display consumed and available disk space for the specific file system.

Whenever you run this Linux command-line utility, it displays the amount of used and available blocks, total disk space, and a summary of where the file system is mounted.

In short, the dubbed “df” command is a helpful tool to get disk space information having file name arguments.

df Command Syntax:

Syntax of the “df” command-line tool is:

df [Options]… [File]…

df Command:

Execute the “df” command in the terminal without any filename. It will print the complete statistics of disk space in tabular form, including total, used, available, and the root directory where files are mounted on.

$ df

df Command Options:

Several options come under the flag of the “df” command.

Print File System Type:

When we use the “-T” option in the terminal, it will print the machine's file system type in output.

$ df -T

As you can see, a new column “Type” is displayed on the terminal with other information.

Include Particular File System Type:

In the “-T” option's section (mentioned above), we have seen a column containing file system type. Select any specific file system type if you want to display its output separately. For this “-t” option is used. When you used this option with file-name, it will print the output of that particular file system.

For example, if we want to print the disk space information of the file system “devtmpfs.” So, the command would be:

$ df -t devtmpfs

Exclude Particular File System Type:

To exclude any particular file system type from the result, use the “-x” option with the file type. Once you execute this command option, it will print all other file system types except this particular one.

For example, if we want to exclude the “devtmpfs” file type from the output, the command would be:

$ df -x devtmpfs

Display Output in Human readable form:

The “df” command is a user-friendly tool; it supports an easily readable option for humans. For this, use the “-h” option in the command-line, and the output displayed on the terminal will be understandable for the human.

You can see, it displayed the size of powers GBs as G, MBs as M, and KBs as K. Now, it is easy to understand the output.

Display Inode Information:

The “-i” option is used to show Inode information in the terminal instead of disk space information. When you run this option, it will show the “Inode” column along with “IUsed” and “IFree” columns.

$ df -i

Display Grand Total Size:

Use the “-total” option to print the total for size, availability, and used space.

$ df --total

Print Help Message:

The “help” option is used to print the help message about the “df” command and its supported options.

$ df --help

Display Version:

To print version information of the “df” command tool, use the “version” option.

$ df --version

Some Other Useful Options:

Conclusion:

The “df” is a standard tool to display disk space information in Linux-like systems. It is abbreviated as “Disk Filesystem.” This tutorial has included a detailed note about the working of the “df” command in the terminal and listed its several options.

OpenTTD vs Simutrans
Creating your own transport simulation can be fun, relaxing and extremely enticing. That's why you need to make sure that you try out as many games as...
OpenTTD Tutorial
OpenTTD is one of the most popular business simulation games out there. In this game, you need to create a wonderful transportation business. However,...
SuperTuxKart for Linux
SuperTuxKart is a great title designed to bring you the Mario Kart experience free of charge on your Linux system. It is pretty challenging and fun to...