|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
ps avg | grep ? filter the desired out put.
Hi Folk, Following is the command I used to get data related to the DataFlowEngine. I wanted to know the % usage of cpu and memory. Code:
ps avg | grep Data This command will show the processes with its PID as : Code:
PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND 303248 - A 306:32 378 96628 77420 xx 20 56 0.0 0.0 DataFlo 315404 - A 7:52 109 77944 51104 xx 20 56 0.0 0.0 DataFlo 426060 - A 230:41 16 100196 100252 xx 20 56 0.1 0.0 DataFlo Now I want the further details related to that PID that I can get after searching in ps -elf table. How to use the output of above given command (ps avg | grep Data) as input to the ps -elf and then filter the PID and Process Name using one line command? If script then it would be ok as well. I know we can use awk or sed command to filter that. Last edited by Yogesh Sawant; 04-07-2009 at 04:33 AM.. Reason: added code tags |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Code:
for DATAPID in `ps -avg | grep Data | awk '{ print $1 }'`; do
ps -elf | grep ${DATAPID} | grep -v grep
doneNot an elegant one-liner but it might provide what you are after. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Grep script to filter | kevin9 | Shell Programming and Scripting | 2 | 02-21-2009 12:59 AM |
| How to grep (say)last-3 and next-3 lines of Desired Pattern | Sujan Banerjee | Solaris | 3 | 11-06-2008 04:01 AM |
| Desired Format ! | prasanth_babu | HP-UX | 1 | 02-20-2008 09:31 AM |
| grep a log file to filter previous dates | pinpe | Shell Programming and Scripting | 5 | 08-03-2007 01:25 PM |
| Filter results through pipe with grep | ckandreou | UNIX for Dummies Questions & Answers | 1 | 07-10-2006 02:04 PM |
|
|