df command in Linux and it perimeters

df command in Linux and it perimeters

The df command in Linux is used to display disk space usage information for file systems mounted on the system. It provides details about the total disk space, used space, available space, and the file system’s mount point.

The basic syntax of the df command is as follows:

Bash
df [options] [directory]

Here’s a table explaining the main parameters and options of the df command:

Parameter/OptionDescription
directoryOptional. Specifies the directory or mount point for which you want to see disk space usage.
-h, –human-readablePrint sizes in human-readable format (e.g., 1K, 234M, 2G).
-H, –siLike -h, but uses powers of 1000 instead of 1024.
-T, –print-typePrint the file system type.
-t, –typeLimit the display to file systems of specific types (comma-separated).
–helpDisplay help and exit.
–versionOutput version information and exit.

Now, let’s see some examples of how to use the df command:

  1. Display disk space usage for all mounted file systems:
Bash
df

This will show the disk space usage for all file systems mounted on the system.

  1. Display disk space usage in human-readable format:
Bash
df -h

This will show disk space usage with sizes in a human-readable format (e.g., 1K, 234M, 2G).

  1. Display disk space usage using powers of 1000:
Bash
df -H

This will display disk space usage using powers of 1000 instead of the default 1024.

  1. Print the file system type along with disk space usage:
Bash
df -T

This will show the file system type for each mounted file system.

  1. Limit the display to specific file system types (e.g., ext4, nfs):
Bash
df -t ext4,nfs

This will display disk space usage only for file systems of types ext4 and nfs.

  1. Display disk space usage for a specific directory:
Bash
df /home

This will show the disk space usage for the /home directory.

The df command is useful for monitoring disk space usage and identifying file systems that may be running out of space. It helps administrators and users understand the disk space distribution across different partitions and file systems, allowing them to take appropriate actions to free up space or manage storage efficiently.

Total
0
Shares

Leave a Reply

Previous Post
su command in Linux and it perimeters

su command in Linux and it perimeters

Next Post
du command in Linux and it perimeters

du command in Linux and it perimeters

Related Posts