Print a process tree using ps

from https://www.cyberciti.biz/faq/show-all-running-processes-in-linux/


Linux commands show all running processes

Apart from ps command, you can also use the following commands to display info about processes on Linux operating systems:
  1. top command : Display and update sorted information about Linux processes.
  2. atop command : Advanced System & Process Monitor for Linux.
  3. htop command : Interactive process viewer in Linux.
  4. pgrep command : Look up or signal processes based on name and other attributes.
  5. pstree command : Display a tree of processes.


# ps -ejH
#
ps axjf

Sample outputs:
Linux see all running process using ps command

How to display a tree of processes

The pstree command shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown.
$ pstree
Sample outputs:
Fig.02: pstree - Display a tree of processes

Linux running processes with top command

The top program provides a dynamic real-time view of a running system. Type the top at command prompt:
# top
Sample outputs:
Fig.01: top command: Show All Running Processes in Linux

See process run by user vivek

Select by process by effective user ID (EUID) or name by passing username such as vivek:
# ps -u vivek

How to list process with the ps command

Type the following ps command to display all running process:
# ps -aux | less
OR
# ps aux | less
Where,
  • A : Select all processes
  • u : Select all processes on a terminal, including those of other users
  • x : Select processes without controlling ttys
Linux show all running processes


































留言

熱門文章