The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
prstat output senabhi SUN Solaris 5 05-14-2009 07:39 AM
prstat in shell madmat Shell Programming and Scripting 4 02-07-2007 04:46 AM
Mem analyze / vmstat, prstat ... unclefab SUN Solaris 2 01-24-2007 02:58 PM
Redirect the output of prstat vastare Shell Programming and Scripting 2 03-14-2006 07:55 AM
Help with prstat vibhor_agarwali UNIX for Dummies Questions & Answers 6 04-07-2005 08:01 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-14-2008
vivsiv vivsiv is offline
Registered User
  
 

Join Date: Jun 2006
Location: Los Angeles
Posts: 17
prstat problem

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.
  #2 (permalink)  
Old 02-14-2008
vivsiv vivsiv is offline
Registered User
  
 

Join Date: Jun 2006
Location: Los Angeles
Posts: 17
i got it

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.

Last edited by vivsiv; 02-15-2008 at 02:53 AM.. Reason: correcting
  #3 (permalink)  
Old 02-15-2008
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,293
This should work:

Code:
prstat -t|grep oadmin|cut -d" " -f5
Regards
  #4 (permalink)  
Old 02-15-2008
alexander.voelz alexander.voelz is offline
Registered User
  
 

Join Date: Sep 2004
Location: Berlin,Germany,Europe
Posts: 5
prstat needs count option

try:

Code:
prstat -t 1 1 | gawk '/oadmin/{print $3;}'
  #5 (permalink)  
Old 02-15-2008
girish.batra girish.batra is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 73
prstat -t>a ; more a|grep smmp

press ctl+c

you get your output
  #6 (permalink)  
Old 02-15-2008
Kevin_L Kevin_L is offline
Registered User
  
 

Join Date: Jul 2007
Location: NJ, USA
Posts: 1
This worked for me:

prstat -t 1 1 | awk '/oadmin/{print $5;}'
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:48 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0