- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- Re: awk command and grep command
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
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
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
тАО11-23-2008 07:10 PM
тАО11-23-2008 07:10 PM
awk command and grep command
I got the result of '
> vmstat -P
Total Physical Memory = 4096.00 M
= 524288 pages
Physical Memory Clusters:
start_pfn end_pfn type size_pages / size_bytes
0 885 pal 885 / 6.91M
885 524279 os 523394 / 4089.02M
524279 524288 pal 9 / 72.00k
Physical Memory Use:
start_pfn end_pfn type size_pages / size_bytes
885 1033 scavenge 148 / 1.16M
1033 2191 text 1158 / 9.05M
2191 2452 data 261 / 2.04M
2452 2933 bss 481 / 3.76M
2933 3224 kdebug 291 / 2.27M
3224 3231 cfgmgmt 7 / 56.00k
3231 3233 locks 2 / 16.00k
3233 3249 pmap 16 / 128.00k
3249 4001 unixtable 752 / 5.88M
4001 4049 logs 48 / 384.00k
4049 16216 vmtables 12167 / 95.05M
16216 524279 managed 508063 / 3969.24M
============================
Total Physical Memory Use: 523394 / 4089.02M
Managed Pages Break Down:
free pages = 167589
active pages = 151813
inactive pages = 18504
wired pages = 57504
ubc pages = 112801
==================
Total = 508211
WIRED Pages Break Down:
vm wired pages = 11887
ubc wired pages = 0
meta data pages = 5210
malloc pages = 25153
contig pages = 3738
user ptepages = 10697
kernel ptepages = 453
free ptepages = 9
==================
Total = 57147
'
but,How can i get the number of '4096.00'?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2008 08:18 PM
тАО11-23-2008 08:18 PM
Re: awk command and grep command
# vmstat -P |grep "Total Physical Memory" |head -1|awk '{print $5}'
Not sure if it will work for all cases.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2008 12:50 AM
тАО11-24-2008 12:50 AM
Re: awk command and grep command
" vmstat -P |grep "=" |head -2|awk '{print $2}' " returns the result of
"
Physical
524288 "
"Physical" is not what i want,what is wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2008 12:40 PM
тАО11-24-2008 12:40 PM
Re: awk command and grep command
You could eliminate the grep and head:
vmstat -P | awk '/Total Physical Memory/ {print $5; exit}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2008 06:52 PM
тАО11-24-2008 06:52 PM
Re: awk command and grep command
You got different result because, you typed a different grep pattern!
Moreover, you could use the command provided by Dennis now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2008 07:18 PM
тАО11-24-2008 07:18 PM
Re: awk command and grep command
Thanks.