Avatar of Newton
Newton
Flag for India asked on

Ptree equivalent in Linux

In Solaris we have ptree command.

My Question is, is there any equivalent command in Linux?


Linux

Avatar of undefined
Last Comment
rindi

8/22/2022 - Mon
rindi

You are probably looking for the "pstree" command...
Newton

ASKER
Hi rindi,

I don't see pstree in my system.
Is there any alternate way to see the output like tree?
rindi

On my system (a Debian Distro), it is there. It seems to be a part of the psmisc package. Maybe you need to install that package using your Distro's Package Manager.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Duncan Roe

I use ps -axfu run as root
Newton

ASKER
Hi Duncan,
Thanks. `ps -axfu` list all the processes in the system. Is there any way, we get output only for one PID?
ASKER CERTIFIED SOLUTION
Duncan Roe

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Duncan Roe

Sorry, it is too clunky. I'm sure it can be done, but I'm giving up. Just get procps-ng.
@rindi: psmisc is part of procps-ng.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
rindi

That probably depends on the Distro. In Debian it is it's own package which you can install via apt install psmisc, & there is no procps-ng package.