Sponsored Content
Full Discussion: [Tip] ptree for Linux
Top Forums UNIX for Advanced & Expert Users [Tip] ptree for Linux Post 303043037 by stomp on Thursday 16th of January 2020 04:53:47 AM
Old 01-16-2020
I'd like to mention --forest option of ps which I use regularly under linux.

It lacks the here mentioned feature to show only the tree concerning a special pid.

Code:
ps ax --forest

Code:
...
 2406 ?        S      0:00 /usr/lib/x86_64-linux-gnu/libexec/kf5/start_kdeinit --kded +kcminit_startup
 2411 ?        Ss     0:00 kdeinit5: Running...
 2413 ?        Sl     0:00  \_ /usr/lib/x86_64-linux-gnu/libexec/kf5/klauncher --fd=9
 2420 ?        Sl     0:01  \_ kded5 [kdeinit5]
 2761 ?        Sl     0:00  \_ /usr/bin/ksmserver
 2791 ?        Sl     0:09  |   \_ kwin_x11 -session 10dde16a61000157748587300000029330001_1578584288_66599
 2799 ?        Sl     0:02  |   \_ /usr/bin/krunner
 2800 ?        Sl     0:29  |   \_ /usr/bin/plasmashell --shut-up
 2801 ?        Sl     0:00  |   \_ /usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1
 2802 ?        Sl     0:00  |   \_ /usr/bin/xembedsniproxy
 2888 ?        Sl     0:00  |   \_ /usr/lib/at-spi2-core/at-spi-bus-launcher --launch-immediately
 2910 ?        S      0:00  |   |   \_ /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
 2889 ?        Sl     0:00  |   \_ /usr/bin/korgac
 2856 ?        Sl     0:01  \_ /usr/bin/owncloud -session 10dde16a61000157848162200000034850009_1578584288_58686
 3486 ?        Sl     2:15  \_ /usr/local/bin/firefox
 3634 ?        Sl     0:41  |   \_ /opt/firefox/firefox-61.0.1/firefox-bin -contentproc -childID 3 -isForBrowser -prefsLen 6100 -prefMapSize 258569 -parentBuildID 20200107212822 -greomni /opt/fire
 6193 ?        Sl     0:18  |   \_ /opt/firefox/firefox-61.0.1/firefox-bin -contentproc -childID 20 -isForBrowser -prefsLen 7615 -prefMapSize 258569 -parentBuildID 20200107212822 -greomni /opt/fir
 6565 ?        Sl     0:04  |   \_ /opt/firefox/firefox-61.0.1/firefox-bin -contentproc -childID 25 -isForBrowser -prefsLen 7615 -prefMapSize 258569 -parentBuildID 20200107212822 -greomni /opt/fir
 6687 ?        Sl     0:00  |   \_ /opt/firefox/firefox-61.0.1/firefox-bin -contentproc -childID 26 -isForBrowser -prefsLen 7615 -prefMapSize 258569 -parentBuildID 20200107212822 -greomni /opt/fir
 3968 ?        Sl     0:08  \_ /usr/bin/konsole
 3975 pts/1    Ss     0:00  |   \_ /bin/bash
 3985 pts/1    S+     0:00  |   |   \_ ssh webhost01
 5438 pts/2    Ss     0:00  |   \_ /bin/bash
 5445 pts/2    S+     0:00  |   |   \_ ssh webhost01
 6922 pts/3    Ss     0:00  |   \_ /bin/bash
 6984 pts/3    R+     0:00  |       \_ ps ax --forest
 4508 ?        Sl     0:33  \_ /usr/lib/thunderbird/thunderbird
...

These 2 Users Gave Thanks to stomp For This Post:
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Meaning of ps -afe ,ps -fp and ptree

Hello, I was searching for the meaning of commands like ps -afe ,ps -fp and ptree but was not able to find there exact meaning .... Pls help me in getting these... Thanks in advance, Pradeep (1 Reply)
Discussion started by: PradeepRed
1 Replies

2. Gentoo

ptree for linux

at work, I'm a UNIX administrator, but at home I use openSUSE 11. One of the commands that I use to assist me in trouble shooting A LOT is called ptree process tree. does anyone know of a ptree for linux? yes, I can just use ps -ef and see who the parent pid is and then 'ps -ef | grep <parent... (4 Replies)
Discussion started by: james.witte
4 Replies

3. Red Hat

pfiles and pstack and ptree

Can someone tell me the Linux equivalent for pstack and pfiles and ptree which are Solaris commands. (1 Reply)
Discussion started by: bdsffl
1 Replies

4. Solaris

kill the processes seen under ptree

Hi, How to kill the processes running under ptree ? I am noticing lot of processes running under ptree with ssh ? I tried to kill with -9 option which is not working ? Thanks, Radhika. (2 Replies)
Discussion started by: radhirk
2 Replies

5. Shell Programming and Scripting

prstat from ptree ...

Hi, I know how to figure out the list of PID from my application name : ptree `pgrep MyApp` | awk '{print $1}' But I dont know how to pipe it for prstat -p <pidlist> ptree `pgrep MyApp` | awk '{print $1}' | prstat -p ??? I would like to monitor every ptree PID from my application. ... (4 Replies)
Discussion started by: RickTrader
4 Replies

6. Linux

ct, cu, tip, on commands in Linux

Please help me to find out the equivalent commands for the following solaris commands in Linux 1. ct 2. cu 3. tip 4. on Your help will be appreciated. Thanks in advance. ~Saravana (0 Replies)
Discussion started by: tsaravanan
0 Replies

7. UNIX for Dummies Questions & Answers

Linux Tip: How to Configure PPP for dialup for a single machine?

I shall explain how to setup PPP on your Linux machine, so that you can connect to the Internet using an external modem and a Dialup connection. This article explains the setup for the superuser alone (Not normal users).My Setup : My external modem (56kbps) is connected to the Serial Port :... (0 Replies)
Discussion started by: EliteHussar
0 Replies

8. Linux

similar command of ptree in linux

Hello guys, Is there any command to check the all child processes of a process like `ptree`? ptree is not working in Linux.. Regards, Raghu (3 Replies)
Discussion started by: raghu.iv85
3 Replies
All times are GMT -4. The time now is 07:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy