![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find CPU per process in AIX | yamsin789 | AIX | 1 | 04-01-2009 07:13 AM |
| is there a way to find out the tty from which the process is launched | sleepy_11 | UNIX for Advanced & Expert Users | 1 | 04-07-2008 05:08 AM |
| How to find which process is using up too much CPU | 0ktalmagik | SUN Solaris | 1 | 06-03-2006 03:48 AM |
| how to find the chid process id from given parent process id | guhas | Shell Programming and Scripting | 3 | 10-13-2005 08:13 AM |
| find eof, then process | mfilby | Shell Programming and Scripting | 12 | 12-22-2003 06:29 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
See if this appraoch helps - check the process
|
|
|||||
|
Quote:
ps -ef | awk '$3 == 1' As always use nawk instead of awk on Suns. The above code gives everything with a ppid of 1. You want only some of those. Maybe you can match something in the command line. Let's say all of the processes you want have abcxyz in the command line: ps -ef | awk '$3 == 1 && $8 ~ "abcxyz"' Now you should have a list of just the processes you want. Want just the pid's? ps -ef | awk '$3 == 1 && $8 ~ "abcxyz" {print $2}' Wanna kill 'em? kill $(ps -ef | awk '$3 == 1 && $8 ~ "abcxyz" {print $2}') |
|
|||||
|
I don't understand how the process age fits into this problem. In general, no, it is hard to get the age of a process. The tools mostly display start time. So you need to do calculations. I believe that you use SunOS, though. Bear in mind that on a Sun, you can using the find command on processes by using /proc. Each process gets a subdirectory. So as root you can do:
cd /proc find . ! -name . -prune -mtime +3 -print | xargs ls -ld or something like that. |
![]() |
| Bookmarks |
| Tags |
| mtime |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|