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
-
Exclude
tmpfs:
Sincetmpfsis a virtual filesystem stored in RAM, it often clutters the output. To hide alltmpfsentries, run:df -h -x tmpfs -
Exclude multiple types:
If you want to exclude more than one type (for example, bothtmpfsanddevtmpfs), you can use the-xoption 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).