On Aug 24, 2025, at 17:01, Collin Funk <[email protected]> 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

But I don't want to exclude apfs or any specific filesystem type.
I would like to exclude "certain strings in the output using regex patterns" 
which in my immediate use case would be to exclude "com.apple.TimeMachine" but 
I generalized to regex for possible future situations.

I didn't know that -x was already taken.  It isn't valid in Apple's version.  
Maybe -s string and -nos string ?

> For other fields I think that 'df | grep -v text' works fine.

No, because 'df' creates the layout and grep doesn't change it.  When two or 
more filesystems have names like
com.apple.TimeMachine.2025-08-24-205834.local@/dev/disk1s1 
the ###-blocks column is about four dozen spaces away from the ones that have 
names like /dev/disk1s5
And the size columns for my 4 TB SSD are each ten digits, so that even when I 
full-screen the window (151-characters), the mount points have to wrap,  
Especially the Time Machine snaphosts which have names like
/Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/MBP/2025-08-24-205834/Macintosh
 SSD - Data

-- 
Wes Groleau
伟思礼

“French does have a certain je ne sais quoi, but I don't know what it is.”
    — Jeffrey Goldberg


Reply via email to