Cheat Sheet #day67 - df

Cheat Sheet #day67 - df

df Command Cheatsheet

The df command in Unix-like systems is used to display information about disk space usage. It provides details on disk space usage for mounted filesystems. Here’s a quick reference guide:

Basic Syntax

df [OPTION]... [FILE]...

Common Options

  • -h, --human-readable: Print sizes in a human-readable format (e.g., KB, MB, GB).

      df -h
    
  • -T, --print-type: Print filesystem type.

      df -T
    
  • -i, --inodes: Display inode usage instead of block usage.

      df -i
    
  • -a, --all: Include all filesystems, including those with 0 blocks.

      df -a
    
  • -t TYPE, --type=TYPE: Limit listing to filesystems of type TYPE (e.g., ext4, nfs).

      df -t ext4
    

Examples

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

     df -h
    
  2. Show filesystem type along with usage:

     df -T
    
  3. Display inode usage instead of block usage:

     df -i
    
  4. Include all filesystems, even those with 0 blocks:

     df -a
    
  5. Limit listing to specific filesystem type (e.g., ext4):

     df -t ext4
    

Additional Information

  • Help option:

      df --help
    
  • View manual page for df:

      man df
    

The df command is essential for monitoring disk space usage on Unix-like systems, providing detailed information about mounted filesystems. For more detailed options and usage scenarios, refer to the man page or use df --help.

Did you find this article valuable?

Support Cloud Tuned by becoming a sponsor. Any amount is appreciated!