What are common df options?

0103

The df command in Linux comes with several options that enhance its functionality and output. Here are some of the most common options:

  1. -h: Human-readable format. Displays sizes in KB, MB, or GB, making it easier to understand.

    df -h
  2. -T: Displays the filesystem type along with the disk usage information.

    df -T
  3. -i: Shows inode usage instead of block usage. This is useful for checking how many files can be created on a filesystem.

    df -i
  4. -a: Includes all filesystems, even those that are not currently mounted.

    df -a
  5. -t <type>: Limits the output to filesystems of a specific type (e.g., ext4, nfs).

    df -t ext4
  6. -x <type>: Excludes filesystems of a specific type from the output.

    df -x tmpfs
  7. --total: Displays a total summary of all filesystems at the end of the output.

    df --total
  8. -k: Displays sizes in kilobytes (default behavior).

    df -k
  9. -m: Displays sizes in megabytes.

    df -m

Example Usage

To see a human-readable summary of all mounted filesystems with their types, you can combine options:

df -hT

These options allow you to customize the output of the df command to suit your needs, making it a versatile tool for monitoring disk usage. If you have any further questions or need examples, feel free to ask!

0 Comments

no data
Be the first to share your comment!