- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- awk in df -k output.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2014 11:21 PM
04-03-2014 11:21 PM
awk in df -k output.
Hi,
$ bdf /tmp /usr /var |grep -v "Filesystem"|grep "%"|awk '{print $NF, $(NF-1)}'
/tmp 9%
/usr 37%
/var 50%
I am able to get File system usage correctly using bdf as what I expected.
I need the output to be same for df -k as bdf output.
I tried using different ways to df -k ,but i am not able to get the df -k output as same as bdf.
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2014 12:24 AM
04-04-2014 12:24 AM
Re: awk in df -k output.
Why would you ever want to use df when you have bdf?
You may want to look at Bill's bdfmegs:
http://h30499.www3.hp.com/t5/System-Administration/bdfmegs-Feb2014-version/m-p/6364361
But this should work:
df -k | awk '
substr($0, 1, 1) != " " {
name = $1
}
/%/ {
print name, $1 $2
}'