Page 1 of 1

pstree - manage your running services!

Posted: 13 Aug 2016, 13:35
by viking60
:tux5: We have the ps command that can tell us a lot about our running services. If we want to show the entire enchilada we can type:

Code: Select all

ps aux


And that will show a lot! It is probably a loong list. a stands for all u shows more details and x for showing all processes that are not assigned to a TTY.

You can use grep and specify but there is a better and faster way to get an overview of your running services:

Code: Select all

pstree


This will show your running processes in the shape of a tree:
:A
Image


In Centos 7 I had to install psmisc first because it is not there after a minimal install.

You can specify a lot like adding command line info with

Code: Select all

 pstree -a
Maybe you need the PID (Process ID) too? No problem:
:A

Code: Select all

pstree -p


You may also view all processes that are initiated by you or root like this:

Code: Select all

pstree viking
or

Code: Select all

pstree root


pstree lists by alphabetical order as default and it is great for getting a quick overview over what is going on when you come to a new Linux PC.

There are lot of options so check the man page.

To get a quick overview you can also use programs like Glances or Atop

Pstree presents the running processes in a tidy manner.