Questions tagged [pstree]

A Unix command that shows the running processes as a tree. It is used as a more visual alternative to the ps command.

22 questions
0
votes
1 answer

bash: Dump a parent call tree

I'm looking to instrument a recursive Makefile, and I want to see the complete calling tree that got me to where I'm at (which includes all parameters, etc). I don't care about the other processes on the system. What I'm looking for is essentially…
HardcoreHenry
  • 5,909
  • 2
  • 19
  • 44
0
votes
3 answers

get the pid of specified process name from pstree by using shell script

I am using pstree to get a set of process and the result will be like processA(123)---processB(124)---processC(125)---processTarget(126)---processD(127) I would like to use the keyword "processTarget" to get the pid, that is 126. The reason why i…
Teddy
  • 137
  • 1
  • 1
  • 8
0
votes
0 answers

Cron jobs run twice (CentOS6.5)

I noticed that logwatch output from 1 of my servers is emailed twice. After giving a deeper look to the thing, I found out that it's not only the logwatch, but all the cron jobs simply run twice. Yesterday I spend some hours on research, but did…
0
votes
3 answers

Use pstree inside awk command

I want to run pstree on a set of pid which I find using ps ps -aux | grep ^username | awk '{pstree $2}' Unfortunately, the output is empty, but if I run the pstree command manually with the same pids I get the desired output. What is wrong with the…
e271p314
  • 3,841
  • 7
  • 36
  • 61
0
votes
3 answers

How to use pipe in perl

My syntax is my $pstree = `pstree -p $pid|wc`; but i am getting an error. sh: -c: line 1: syntax error near unexpected token `|' any thoughts?
-1
votes
1 answer

python: recreating system process tree from ps command in a dictionary

I'm new to python and I'm trying to recreating in a python dictionary the processes hierarchy like the unix pstree does. Unfortunately I cannot use the wonderful psutil library cause I don't have permissions to search into /proc path. Did somebody…
chew23
  • 1
-3
votes
1 answer

C - pstree equivalent

In BASH there is a pstree command which 'draws' a tree of processes. I am wondering what is the similar function in C programming language? A simple example would be appreciated.
user1926550
  • 539
  • 5
  • 10
  • 18
1
2