when I do df I get a rather difficult to read screen the data is not lined up correctly is there anyway I can pass it to another command to make it look ok ?
Try :
df|awk -F" " '{printf("%s\t%s\t%s\n",$1,$2,$3)}'
(This is only showing the first 3 fields - expand as required - add more tabs (\t) as req'd too)
HTH
And even better - if you've got some long filesystem names : 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)} } '
%+20s adjust the string to the right within 20 chars
%-20s adjust the string to the left within 20 chars
%.20s truncate the string to the 20 first chars
see man printf for more details
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.