On 8/25/25 06:21, "W. Wesley Groleau (伟思礼)" wrote:
On Aug 24, 2025, at 17:01, Collin Funk <[email protected]> wrote:
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

Formatting could be adjusted after filtering e.g. with `column -t`.

Example: I'm only showing ext4 (-t ext4) here ...

  $ df -t ext4
  Filesystem          1K-blocks      Used Available Use% Mounted on
  /dev/sda2            20466256  17738772   1662524  92% /
  /dev/sda5           619071928 152604252 466451292  25% /media/data
  /usr/local/dev/sdb2 215635184 201885940  13732860  94% /usr/local/mnt/sdb2

... and filter out one with a longer device name:

  $ df -t ext4 | grep -v local
  Filesystem          1K-blocks      Used Available Use% Mounted on
  /dev/sda2            20466256  17738772   1662524  92% /
  /dev/sda5           619071928 152604252 466451292  25% /media/data

The Filesystem column is wider than necessary.
Now, correct this again:

  $ df -t ext4 | grep -v local | column -t
  Filesystem  1K-blocks  Used       Available  Use%  Mounted          on
  /dev/sda2   20466256   17738772   1662524    92%   /
  /dev/sda5   619071928  152604252  466451292  25%   /media/data

(okay, the column header "Mounted on" is messed up a bit.)

FWIW: you can control the columns and their order with 'df --output=...'.

P.S. Please don't post screenshots here.  Instead - as we're talking about
textual output - you can paste the sample output directly in the mail.

Have a nice day,
Berny



Reply via email to