The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Filesystems, Disks and Memory
Google UNIX.COM


Filesystems, Disks and Memory Questions involving NAS, SAN, RAID, Robotic Libraries, backups, etc go here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Parent child Relation !! using awk/sed ??? varungupta UNIX for Advanced & Expert Users 0 01-29-2008 10:24 AM
exiting a child without stopping the parent madpenguin Shell Programming and Scripting 5 09-19-2007 07:45 PM
Parent/Child Processes yoi2hot4ya Shell Programming and Scripting 2 05-31-2006 10:27 AM
kill parent and child larry UNIX for Dummies Questions & Answers 4 01-11-2003 08:18 PM
what are parent and child processes all about? xyyz UNIX for Dummies Questions & Answers 1 04-26-2002 12:53 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-16-2002
Registered User
 

Join Date: Feb 2001
Location: Groningen, the Netherlands
Posts: 1
Unhappy How hard can it be? ps child/parent


Since I'm fairly new to the scene and don't have much experience in shell programming, I decided to check out the net for a useful script or two.
What I'm looking for is a script that would let me enter a PID and then show the process tree associated with it.
So it would display the (grand-) parents up to top-level and all children for that process, preferably in a tree like manner.
This would come in quite handy if I have to kill a certain process, because it would help me identify related processes.
Is there a script that would do that or just simply display a tree starting at PID 0?
You'd think it would be easy to find, but apparently it's harder to create it than I thought, because after several hours of browsing, I haven't found anything that comes close.
Anyone here that can help me?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-16-2002
PxT's Avatar
PxT PxT is offline
Registered User
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 905
Sounds like you are looking for pstree (although it is not a shell script). BTW, freshmeat.net is usually the best place to search for open source software like this.
Reply With Quote
  #3 (permalink)  
Old 05-25-2002
Registered User
 

Join Date: May 2002
Posts: 10
s8

i believe pstree or ptree is only avaialble for Solaris 8 or higher


using awk
try using a script in the form

ps -ef | awk ' $2 /mycommand/'


jasmine (SCSA & MCSE)
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:45 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