Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-04-2010, 04:43 AM   #1
LQ Newbie
Registered: Jan 2010
Posts: 3

Rep: Reputation: 0
What is the Linux equivalant commands of Solaris' prstat & ptree?

Hi Folks,
Could someone advise the solaris' equivalant commands of prstat & ptree in Linux flavour.

Thanks for your time !

Old 02-04-2010, 10:10 AM   #2
Registered: Dec 2009
Distribution: Slackware
Posts: 113

Rep: Reputation: 23
I believe the Linux commands you are looking for are top and pstree.

Old 12-08-2011, 06:25 PM   #3
Registered: Dec 2011
Location: Simplicity
Posts: 651

Rep: Reputation: 299Reputation: 299Reputation: 299
[Just discovered this great forum]

I found the ps -H option useful,
but missed the Solaris filter options, so had to add it.
Here is my ptree for Linux:

# Solaris style ptree
# by Michael Tosch

[ -x /usr/bin/ptree ] && exec /usr/bin/ptree "$@"

# Print process tree
# $1 = PID : extract tree for this process
# $1 = user : filter for this (existing) user
# $1 = user $2 = PID : do both

export PATH

case $1 in
[a-z]*) psopt="-u $1";shift;;

[ -z "$1" ] &&
exec ps $psopt -Ho pid=,args=

#some effort to add less to the ps list
trap 'rm $tmp' 0 HUP INT TERM
ps $psopt -Ho pid=,args= >$tmp
<$tmp awk '
{ ci=index(substr($0,7),$2); o[ci]=$0 }
ci>s[a] { s[++a]=ci }
$1==pid {
for(i=1;i<=a;i++) {
si=s[i]; if(si<=ci) print o[si]
ci<walkdown { exit }
walkdown!=0 { print }
' pid="$1"


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Solaris Commands help madcatver1 Solaris / OpenSolaris 4 01-30-2008 02:26 AM
implement ptree using bash blizunt7 Fedora 1 01-20-2006 05:18 PM
need commands in Solaris Uday123 Solaris / OpenSolaris 4 12-16-2005 12:55 PM
ptree equavelent on linux raees Linux - Software 6 04-16-2004 10:38 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:39 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration