vivsiv
February 14, 2008, 10:00pm
1
This will be a smaple output for my prstat -t
NPROC USERNAME SIZE RSS MEMORY TIME CPU
43 root 249M 62M 1.5% 33:50:01 0.1%
12 oadmin 1396M 862M 22% 0:06:49 0.1%
2 acne 3960K 3176K 0.1% 0:00:00 0.0%
4 essagent 10M 7456K 0.2% 0:00:00 0.0%
1 smmsp 4424K 568K 0.0% 0:00:00 0.0%
1 daemon 2544K 1128K 0.0% 0:00:00 0.0%
I want to get the output of only user 'oadmin' so I tried to use
prstat -t | grep oadmin , when i used grep this doesnt seem to work any ideas please.
vivsiv
February 14, 2008, 10:05pm
2
prstat -t -u oadmin doesnot give the output , imean the script never returns.essentially i just want to get the memory variable for user oadmin which is 22 , any ideas how to get this.
This should work:
prstat -t|grep oadmin|cut -d" " -f5
Regards
try:
prstat -t 1 1 | gawk '/oadmin/{print $3;}'
prstat -t>a ; more a|grep smmp
press ctl+c
you get your output
Kevin_L
February 15, 2008, 9:57am
6
This worked for me:
prstat -t 1 1 | awk '/oadmin/{print $5;}'
vivsiv
February 15, 2008, 6:58pm
7
Thanks guys ..all the solutions were helpful and I was able to use the stmt from Kevin into my program.