Hi,
I'm looking to get back the usage % and partition name by using df. Here's my output from normal df
Code:
[root@localhost scripts]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
37G 24G 11G 69% /
/dev/hda1 99M 9.9M 84M 11% /boot
/dev/hdb1 76G 43G 33G 57% /mnt/hdb
/dev/shm 220M 0 220M 0% /dev/shm
No i know i can use grep and awk to fish out what i want,but my problem is the first line. It runs over two lines,i.e for the last rows my Use% is variable $5,but for the second row it is $4 because of the first drive expanding over two rows, so something like this happens..
Code:
[root@localhost scripts]# df -h | grep -vE "^Filesystem|shm|boot" | awk '{print $5 " " $6}'
/
57% /mnt/hdb
I want the ouput to be
Any ideas how i can chagne the command to do this?
Thanks