The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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
finding Background Process Id krk_555 Shell Programming and Scripting 4 10-24-2007 05:34 PM
Finding out process id in a scipt vibhor_agarwali UNIX for Dummies Questions & Answers 2 04-12-2007 05:30 AM
finding idle time of a process Krrishv Shell Programming and Scripting 36 01-10-2007 05:34 AM
finding a process running on a port manduva UNIX for Advanced & Expert Users 8 02-12-2004 02:49 AM
Finding Out When A Process Has Finished? 1cuervo UNIX for Advanced & Expert Users 5 11-02-2001 01:59 AM

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-04-2002
sskb
Guest
 

Posts: n/a
finding process id

is there a way to find the process id of a process because i have same process invoked several times.
when i need to kill them, i get confused with the id.

Thanks,
sskb
Forum Sponsor
  #2 (permalink)  
Old 04-04-2002
killerserv's Avatar
Unix Predator
 

Join Date: Dec 2000
Location: Phoenix, AZ
Posts: 670
best way if you can do ps -aux im sure the process name that you are running. If you can try ps --username for the current process that you execute, by this way you have a idea on which process can be killed, rather then confused of all the systems process. One more suggestion ps -eo "%p" actually it will lists out the normal default output and easy for you to kill (works on AIX havent try on any other OS's) Give a try post back if this doesnt help..
  #3 (permalink)  
Old 04-04-2002
sskb
Guest
 

Posts: n/a
hi killerserv,
thanks for ther response, but i think i need to explain more..

well, I am using a HP Unix system.
and I generally use

ps -u username

and try that..
but when i have a number of same processes and i want to kill only one of them.. such as
i have 4 netscapes running out of which i need to kill one.. i do not know which id corresponds to which process..

like......

$ps -u username | grep netscape

3598 pts/1 0:00 netscape
4561 ? 0:00 netscape
3596 pts/1 4:07 netscape
4560 ? 1:31 netscape
3794 ? 3:34 netscape
3795 ? 0:00 netscape


now is there a way to identify that from the netsacpe itself?

thanks,
sskb
  #4 (permalink)  
Old 04-04-2002
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Well, you could use ps -ef, which shows the parent process id as well, and check to see who (or what) started it.
  #5 (permalink)  
Old 04-05-2002
sskb
Guest
 

Posts: n/a
Hi LivinFree,

I tried
ps -ef |grep netscape

sskb 2430 2429 0 22:55:51 ? 1:35 /usr/local/netscape/netscape
sskb 2508 2507 0 23:14:39 ? 0:09 /usr/local/netscape/netscape


but i do not get anything like the window id..(if there is one).. so that i can know what i need.

well, is there any utility which can give the status of a window along with process id..
i think this would be a great help.

Thanks,
sskb
  #6 (permalink)  
Old 04-07-2002
Registered User
 

Join Date: Feb 2002
Posts: 28
In your example 'ps -ef | grep netscape' resulted in:

sskb 2430 2429 0 22:55:51 ? 1:35 /usr/local/netscape/netscape
sskb 2508 2507 0 23:14:39 ? 0:09 /usr/local/netscape/netscape

In the first line, the PID 2430 represents the PID of the running task 'netscape'. Now if you do a ps on the Parent PID (PPID):

ps -ef | grep 2429

you'll find the owner of the task netscape. -mk
__________________
If it aint broke,
Fix it till it is.
  #7 (permalink)  
Old 04-09-2002
sskb
Guest
 

Posts: n/a
hi Mike,
I get your point..
but I need to correlate between the process id and the process window.
let me know if that isn't making sense,

Regards,
sskb
Google UNIX.COM
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:06 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0