|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Lookup script filename by PID
I'm using the "top" and "ps" commands to look up PID's on a FreeBSD machine, but in the readout from top where the command column reads "perl", there's no way to tell which of my scripts started the process.
Does anyone know of a way to lookup the filename of a script by the PID? |
|
#2
|
|||
|
|||
|
Hi GoofBall,
the ps man page shows how to view the PPID.. that is the Parent PID. You can add it to the ps output a number of ways, for example with the -j switch: Code:
[steven@Napoleon 18:24:55] ~ > ps -j USER PID PPID PGID SID JOBC STAT TT TIME COMMAND steven 6426 6425 6426 6426 0 Ss p0 0:00.06 -bash (bash) steven 6464 6426 6464 6426 1 R+ p0 0:00.00 ps -j steven 6396 91051 6396 91051 1 I+ v0 0:00.04 -bash (bash) with that you can backtrack and usually figure out where a process initiated. does that help? MfG Steven "You ride a horse rather less well than another horse would!", - Edmund Black Adder Last edited by stevengs : January 4th, 2005 at 11:34 AM. |
|
#3
|
|||
|
|||
|
Yeah, I think the the ps utility will do.
I tried it before - without any flags - and as a result could only see the processes owned by me (root) which were ssh commands and therefore didn't look anything like the Perl script file name I was looking for in a greedy process. That's why I couldn't make sense out of it. I don't know why, but it didn't even occur to me to check for a man page ... %> ps -a shows all processes from all users, and a full path under the command column. Thanks for posting back! |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > BSD Help > Lookup script filename by PID |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|