awk output
Hi all,
i am trying to print columns 1 of df command with awk. i used Code:
df -h| awk '{ print $1 }' output: Filesystem /dev/mapper/vg00-lvol00 2031440 /dev/mapper/vg00-lvol04 10157368 /dev/mapper/vg00-lvol02 10157368 /dev/mapper/vg00-lvol03 10157368 /dev/mapper/vg00-lvol05 2031440 /dev/mapper/vg00-lvol07 16568712 /dev/mapper/vg00-lvol06 1015704 |
No idea. Your command works just fine for me.
Are you sure you're entering the command correctly? Because df -h is supposed to turn the output into something human-readable, and your space looks like it's in 1K blocks (the default for df). |
Look at the output of df -h: when the device name is too long, every entry is splitted over two lines, so that the first field in the even lines is the total size of the filesystem. To avoid that, use the -P option:
Code:
df -P | awk '{print $1}' |
Thank you colucix,
it works now. SL00b: typo, i used just df with no h option. |
All times are GMT -5. The time now is 04:42 PM. |