I grabbed this from a previous thread that is now closed. I used this to get the ouput for the df command:
df|awk -F" " '{ if (length($1) > 15 ){printf("%s\t%s\t%s\t%s\t%s\n",$1,$2,$3,$4,$5)} else {printf("%s\t\t%s\t%s\t%s\t%s\n",$1,$2,$3,$4,$5)} } '
problem is when i use df -g |awk -F" " '{ if (length($1) > 15 ){printf("%s\t%s\t%s\t%s\t%s\n",$1,$2,$3,$4,$5)} else {printf("%s\t\t%s\t%s\t%s\t%s\n",$1,$2,$3,$4,$5)} } '
I get ouput like this. Is there a way to exclude the word "blocks" when using the command?
Filesystem GB blocks Used Free %Used Mounted on
/dev/hd4 2.00 0.51 1.49 26% /
/dev/hd2 8.00 3.11 4.89 39% /usr
/dev/hd9var 4.00 0.70 3.30 18% /var
/dev/hd3 4.00 0.06 3.94 2% /tmp
/dev/hd1 8.00 0.36 7.64 5% /home
/dev/hd11admin 0.50 0.00 0.50 1% /admin
df|awk -F" " '{ if (length($1) > 15 ){printf("%s\t%s\t%s\t%s\t%s\n",$1,$2,$3,$4,$5)} else {printf("%s\t\t%s\t%s\t%s\t%s\n",$1,$2,$3,$4,$5)} } '
problem is when i use df -g |awk -F" " '{ if (length($1) > 15 ){printf("%s\t%s\t%s\t%s\t%s\n",$1,$2,$3,$4,$5)} else {printf("%s\t\t%s\t%s\t%s\t%s\n",$1,$2,$3,$4,$5)} } '
I get ouput like this. Is there a way to exclude the word "blocks" when using the command?
Filesystem GB blocks Used Free %Used Mounted on
/dev/hd4 2.00 0.51 1.49 26% /
/dev/hd2 8.00 3.11 4.89 39% /usr
/dev/hd9var 4.00 0.70 3.30 18% /var
/dev/hd3 4.00 0.06 3.94 2% /tmp
/dev/hd1 8.00 0.36 7.64 5% /home
/dev/hd11admin 0.50 0.00 0.50 1% /admin