A Unix command that shows the running processes as a tree. It is used as a more visual alternative to the ps command.
Questions tagged [pstree]
22 questions
13
votes
3 answers
Walking a process tree
I have the following scenario.
The user would type the PID of a process, and the script should show the process and it's subprocesses, sub-subprocesses (and so on) of PID, and it should list it in a tree format.
I tried using pstree PID and ps faux…

mkab
- 221
- 1
- 2
- 5
10
votes
1 answer
Why are some processes shown in pstree not shown in ps -ef?
As title, I run the above commands in sh shell of Linux, but I just cannot find the the child processes of pid 7459 by running "ps -ef | grep dummy".
Can someone explain why there could be such difference between these 2 commands?
They are…

Zii
- 359
- 4
- 10
10
votes
1 answer
What do the curly braces around a process in pstree mean?
The man page does explain what the bracket-braces means (it refers to threads), but I'm wondering what just the braces means.
From this here I can see that auditd and node are like this.
❯ pstree
init─┬─agetty
├─atd
├─auditd───{auditd}
…

Steven Lu
- 41,389
- 58
- 210
- 364
3
votes
1 answer
Using Docker on Grid Engine / Sun Grid Engine / Son of Grid Engine
Does anyone have experience running Docker on Grid Engine / Sun Grid Engine / Son of Grid Engine and being able to monitor the resource used by the daemon? The issue is that when I qsub docker run ..., the actual process in the container is run by…

Alex Rothberg
- 10,243
- 13
- 60
- 120
3
votes
0 answers
Thread pool and fork in c
I have a program that executes find command with pipes and fork.
When I use one main pthread and one pthread per find i have these results (for 2 find) in pstree:
sysexplorer─┬─2*[find]
└─{sysexplorer}
when I use one main pthread and a…

Orion Papadakis
- 398
- 1
- 14
1
vote
1 answer
Is kthreadd included in the linux processes?
I am tasked to implement a simple version of pstree (linux command), while I am confused about the content between what pstree shows and what I find under /proc/[pid] directory.
After I type pstree, it shows the root of the whole process tree is…

Hantong Liu
- 555
- 1
- 3
- 12
1
vote
0 answers
Displaying process tree in last child
I want to create a tree of processes like the one on the picture. The Z process should display the whole tree after seconds given as program argument and I need to handle proper destruction of tree. Additionally, I can't use sleep() command. Program…

Kuba Krzyżyński
- 211
- 5
- 14
1
vote
1 answer
What is a pool thread
When I run pstree -p pid on Linux, it displays a thread tree of a process.
Many processes contains threads called "pool". Some of them live a short lifecycle. They look like:
tracker-extract(2785)─┬─{dconf worker}(2825)
…

objectkuan
- 31
- 6
1
vote
1 answer
How to find list of processes from one point in a tree to another using pstree?
I have some pid and I want to know the process names for every parent all the way up to init.
For example when I type this command that i'm looking for I want to see something like
"init───sshd───bash───mypidprocess"
By default pstree prints out…
user712850
0
votes
0 answers
pgrep and ps don't show all child processes, but pstree does
I'm trying to get list of subprocesses of single process. I'm trying to use pgrep or ps to get list, but they return nothing or return not all subprocesses. But pstree returns all subproceeses
root@ubuntu-1804-fastpanel:~# ps --ppid=13870 -o pid
…

Semyon Bayandin
- 188
- 7
0
votes
0 answers
Record child processes in Linux
I'm looking for a way to record child processes and their arguments spawned by a script or other command. A good example would be recording the build commands spawned by "make" and any children they, in turn, spawn.
In my specific case working with…
0
votes
0 answers
Is there a command, or programmatic way I can use to extract PIDs, and put them in a space-separated list?
Geeks, I seek your help.
In my bash script I will need to kill a process and all its children - so, given a parent pid(2288 in this case) & I need to use that parent pid to find child PIDs, put them in a list and then kill them. I have tried the…

lazyone
- 1
- 3
0
votes
1 answer
C++ fork() - How to display process tree using fork and pstree?
First of all I'm new to Linux and processes, so I couldn't understand the logic of fork() exactly. I want to create a process tree from user input and display this tree with using 'pstree'. However my code displays the tree more than one times. I…

quixoticmind
- 1
- 1
0
votes
2 answers
Printing pstree using execlp()
I need help in printing process tree just right from the code. Thanks to stackoverflow community I wrote a program which creates several process using fork() function and now I need to print on the screen a process tree using execlp() function.
int…

Beginner
- 5
- 4
0
votes
0 answers
How to get rid of Distributed Denial of Service or mining happening on my Linux box
Some strange processing running and eating up all resource.
I'd killed it many times but still its coming up and starting again.
Highly appreciate your help!
Here is the pstree output for reference:
$ pstree -s
init─┬─-bash
…

Avis
- 496
- 1
- 5
- 18