How can the -x option be used to exclude specific filesystem types from the df output?

QuestionsQuestions8 SkillsProDec, 19 2025
0158

To exclude specific filesystem types from the df output, you use the -x (or --exclude-type) option followed by the name of the filesystem type you want to hide.

Here is how it works:

Basic Syntax

df -x [filesystem_type]

Examples

  1. Exclude tmpfs:
    Since tmpfs is a virtual filesystem stored in RAM, it often clutters the output. To hide all tmpfs entries, run:

    df -h -x tmpfs
  2. Exclude multiple types:
    If you want to exclude more than one type (for example, both tmpfs and devtmpfs), you can use the -x option multiple times:

    df -h -x tmpfs -x devtmpfs

Why use it?

The -x option is helpful when you only care about physical disk usage (like your hard drive or SSD) and want to filter out temporary or virtual filesystems that don't represent actual disk space.

Tip: If you prefer to do the opposite—only show a specific type—you can use the lowercase -t option instead (e.g., df -t xfs).

0 Comments

no data
Be the first to share your comment!