How To Check Status Of Active Processes Using PS Command In Linux/Unix?
This post was last updated on August 1st, 2020 at 12:07 pm
In a Unix-like operating system, a process is a program in execution. Linux or Unix is a multitasking operating system that means more than one program can be running at the same time. Whenever a command is issued a new process starts. Kernel identifies a process with a unique id called process id or PID. The processes communicate with each other and with the kernel to carry out a task.
In Linux/Unix ps command is used to display a snapshot of the current processes. Ahead in this article, we will discuss the ps command and its usages in Linux/Unix.
The ps command
The ps command is used to display information about a selection of active processes. It stands for process status. The information displayed using the ps command is a little bit different from that displayed using top command.
Syntax of ps command is given below –
A list of options is given in manual page of ps command you can see it by running –
List all processes for the current shell
If you run ps command without any options then it will display the list of all processes in the current shell.
PID – Process ID
TTY -This is the terminal type that the user logged into
TIME -Total accumulated CPU utilization time
CMD – Name of the command which launches this process
Print the list of all the active processes in a system
If you are using a distribution of Linux then use the following command to display the list of active processes in a system –
ps -A | less
ps -e | less
In FreeBSD run the following command –
Display a process by the process id or PID
You can display the process by using PID, Use the command as given below –
ps -fp PID
For example –
ps -fp 1
Display the threads of a process
To print all the threads of a process, use the following command in the terminal –
ps -fL -C chrome
The given command will print the threads or subprocesses of chrome.
View all the process owned by the parent process
You can use the parent process id or ppid to display the sub-processes of a process by using –
ps --ppid 1
This will display the processes owned by the parent process with ppid 1.
To know more about ps command and its usage see its manual page by executing –
If you want a repetitive update on the selection and displayed information then use top command instead of using ps. If you want to say something on this topic then write to us in the comments below.
You might also like
This post was last updated on August 1st, 2020 at 02:17 pmA file archiver is used to hold multiple files into a single archive file. And a file compression utility
This post was last updated on November 6th, 2016 at 12:32 amVnc server and vnc viewer is used to Remote Access in most of the Linux machines like Fedora, RHEL,
Printing a file is one of the basic functionalities provide by the linux operating system, rather than just printing a file its provides us with a variety of options like