I am reading file utilization on the server with below command. How can I add the hostname in my output as a first column?
Thanks in advance
df -h | grep % | awk '{OFS="\t";print $6,$5}'
Output:
/apps/inf9b2b 43%
/apps/dbclients 13%
/apps/inf9 77%
%, sogrep %or its awk equivalent won't necessarily serve their presumed purpose of filtering out the header. Perhaps you should filter on line number, not by looking for a%sign? With my answer, that would mean changing/%/toNR>1