PS Command In Linux With Example
ps command in linux

PS Command In Linux With Example

In this article, we will learn about Linux PS command and also learn How it is used in Linux and other Linux distributions. If you are a Linux user or a Linux system administrator, then you should know in detail about the use of this command and its other options.

In Linux, many services or processes can be run simultaneously, similarly, through the command PS whose full form is Process Status, all the processes running in the system can be seen according to their PID. It reads all the information related to the process from the Virtual /proc file system.

Run PS Command

As you can see in the screen below, what kind of result you will get after executing the PS command.

PID – Any process (service) running in Linux has a unique ID.
TTY – The full form of TTY is terminal type, which shows that the process has been run on the key terminal.
TIME – Indicates the value of the process that is currently running in minutes and seconds
CMD – By which command the process command has been run

some other options of ps command

If you don’t know much about Linux PS Command and you want to read some manual document about it then you should use the help command. See the below screenshot for how to get the help command for the ps command.

man ps
help command for ps

To check the All process running in the system, run the below command. With the -A option, you can check the current terminal as well as another terminal process.

ps -A 
ps command in linux

If you run the command ps -e instead of ps -A, you will still get the same result.

ps -e
 linux command ps -e

Check Current Terminal Process If you want to check only the process related to this terminal then you run the below command

ps -T
linux command ps -T

Check All process To check all the processes in the system, run the ps -ax command.

ps -ax
ps  -ax

To Check Process In BSD Format To see all the processes running in the system in BSD format, run the ps au or ps aux command.

ps au
ps aux
ps au

Also Read: How to install Linux step by step

Check Process by a specific user To see all the processes run by a specific user, type the name of that user after the flag -U. As given in the below screenshot

ps -u siyaram
Check Process by a specific user

Check Path Of the Process If you want to see the absolute path of a particular process with the PID, use the -L flag.

ps -L 3564
Check Path Of the Process

Check Process Run Buy Root if you want To check all processes which were run by the root user, execute the below command.

ps -U root -u root
Check Process Run Buy Root

Search Process By PID If you want to search the process with the help of PID then use the command given below

ps -c PID_Number
ps -c 2200
Search Process By PID

Search PID By Process Name If you want to search process ID with the help of PID name, then use the command given below

ps -C Process_Name
ps -C chrome
Search PID By Process Name

Use Grep Command to search PID If you want to find process id or other information related to PID with the help of the grep command, you can run the below command

ps -ef |grep cat
Use Grep Command to search PID

Also, read simiservice.com

Rate this post
simi kaithal