Can df output be forced to a single line for each file system?

df generates the following output on one of our systems:

df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/vx/dsk/rootvol    4131866   3593316    497232  88% /
swap                  19963152       144  19963008   1% /var/run
swap                  19985184     22176  19963008   1% /tmp
/dev/vx/dsk/u01      112302757  30834420  80345310  28% /u01
/dev/vx/dsk/node@1       96975      4977     82301   6% /global/.devices/node@1
/dev/vx/dsk/node@2       96975      4988     82290   6% /global/.devices/node@2
/dev/vx/dsk/stkdg/s03
                     1047527424  60483821 925353439   7% /s03
/dev/vx/dsk/stkdg/s02
                     1048576000 266825846 732890795  27% /s02
/dev/vx/dsk/sandg/s01
                     355923968 322686891  31315266  92% /global/s01

[/COLOR]
Is there a way to force the output to display each Filesystem on a single line instead of splitting the lines after the first column? For example, I am trying to get the output to look like this:

df -k
Filesystem             1K-blocks      Used Available Use% Mounted on
/dev/vx/dsk/rootvol      4131866   3593316    497232  88% /
swap                    19963152       144  19963008   1% /var/run
swap                    19985184     22176  19963008   1% /tmp
/dev/vx/dsk/u01        112302757  30834420  80345310  28% /u01
/dev/vx/dsk/node@1         96975      4977     82301   6% /global/.devices/node@1
/dev/vx/dsk/node@2         96975      4988     82290   6% /global/.devices/node@2
/dev/vx/dsk/stkdg/s03 1047527424  60483821 925353439   7% /s03
/dev/vx/dsk/stkdg/s02 1048576000 266825846 732890795  27% /s02
/dev/vx/dsk/sandg/s01  355923968 322686891  31315266  92% /global/s01

Try...

df -Pk

Is there another way? Our version of Unix (Solaris 8) does not support it.

df -Pk
df: unknown option: P
Usage: df [-F FSType] [-abegklntVv] [-o FSType-specific_options] [directory | block_device | resource]

-P stands for

Maybe check the df man page on Solaris for something similar?

df -k|cat

(...)

Note: if you redirect or pipe to other process, you don't need cat:

$ df -k /
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/vx/dsk/bootdg/rootvol
                     5043518 4735581  257502    95%    /
$ df -k /|cat
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/vx/dsk/bootdg/rootvol 5043518 4735581  257502    95%    /
$ df -k />t;cat t
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/vx/dsk/bootdg/rootvol 5043518 4735581  257502    95%    /

Or, with some shells (if you don't mind the (ba|k)sh: __: part :)):

${__?"$(df -k)"}

or:

printf "%s\n" "$(df -k)"

zaxxon,

For whatever reason, we have at least two versions of df installed. One version says that -P is essentially the same as -k.

I'm still getting split lines with the second version of df that I found.

Thanks for the idea though.

radoulov,

This seems to work. Thanks!