Description
As with "df(1)", it would be useful to allow specifying "lfs df --output=FIELD_LIST" to print only specific fields from the output:
FIELD_LIST is a comma-separated list of columns to be included. Valid
field names are: 'source' (alias 'device'), 'itotal' (alias 'inodes'), 'iused', 'iavail' (alias 'ifree'),
'ipcent' (alias 'iusepct', 'ipct'), 'size' (alias 'total', 'btotal'), 'used' (alias 'bused'), 'free' (alias 'bfree'), 'avail' (alias 'bavail'), 'pcent' (alias 'usepct', 'bpct', 'pct'), and 'target'.
This allows printing only specific fields, and would avoid a lot of "lfs df | awk '/OST0000/ { print $4 }'" kind of usage in test scripts, and is likely similarly useful for end users. The aliases are added to match the column headings reported by "df".
It may also be useful to have long options for these, like "lfs df --itotal" or "lfs df --size" or "lfs df --usepct" so that they are accessible in an intuitive manner as needed, but this is not required in the initial patch and could be implemented in a second patch.
Attachments
Issue Links
- is related to
-
LU-18242 allow 'lfs df -m/-o' to specify one MDT/OST
-
- Open
-