Hi,

alain williams <[email protected]> writes:

> On Sun, Aug 24, 2025 at 05:01:31PM -0700, Collin Funk wrote:
>
>> > 2) needs to be able to exclude or "include only" certain strings in the 
>> > output using regex patterns.  Maybe -v, like egrep has, or -x for 
>> > "eXclude" (Apple's version doesn't)
>> 
>> The GNU version of 'df' already has the -x option to exclude file system
>> types. I can exclude apfs file systems like so (which is all of them on
>> this machine):
>> 
>>     $ ./src/df -x apfs
>>     df: no file systems processed
>> 
>> For other fields I think that 'df | grep -v text' works fine.
>
> I did not know about -x so tried it:
>
> $ df -x udev
>
> It shows (amongst others):
>
> udev                         16369064          0   16369064   0% /dev
>
> I tried and it excludes ext4 & tmpfs.
>
> I am running Debian trixie.
>
> Am I missing something or should I file a bug report ?

Thank you for offering to file one, but it isn't a bug.

It is based on the file system type. The type of udev is devtmpfs. See
the following output:

    $ df -T 2>/dev/null | grep -E '^(Filesystem|udev)'
    Filesystem                Type     1K-blocks      Used Available Use% 
Mounted on
    udev                      devtmpfs   3807792         0   3807792   0% /dev

I think the command you want is:

   $ df -x devtmpfs 2>/dev/null | grep -E '^(Filesystem|udev)'
   Filesystem                1K-blocks      Used Available Use% Mounted on

Collin

Reply via email to