Introduction to PS Command In Linux with Illustration:

Reading Time: 3 minutes
Microsoft just blew up the only reason you can't use a Linux desktop | ZDNet

What is PS Command?

Linux process control can be implemented using the commands PS, kill, Bg, fg, jobs, nice, grep, and top. These commands allow background daemons to effectively manage program processes. PS commands are process commands that list running processes and dams, similar to the Windows Task Manager.

Syntax for PS Command:

ps -[options]

Common ps option available:

  1. e – e option indicates a running daemon.

2. f – Use option F to see the process with the full options.

3. l – option lists detailed information about these processes.

4. ef – makes all processes and daemons visible on all TTYS.

5. a – a lists all the processes running on the terminal.

6. x – X lists all processes that are not running on the terminal.

7. aux – combine U and X to list all the processes running on or from the aux terminal and format the result as well as a long list with additional information.

Now let’s see examples of ps commands in linux:

Command 1

ps

output:

Here we provide a TTY and a command to execute to get the basic process ID or run it on the CPU. In this case, it’s a bourne again shell.

Command 2

ps a

output:

Command 3

ps u

output

Command 4

ps aux| less

output

Command 5

ps -f

output

Command 6

ps -ef

output

Here I wanted to see all the processes and daemons here, so F is a process, so if you’re looking for a specific process, it might be useful to go there.

Command 7

ps -l

output

Command 8

ps -x

output

Display process by the command name :

Processes can be selected based on command names :

  1. ps -c [cmd name]

Display all processes for a user or a group


To display all processes for a particular user :

  1. ps -U [user_name]

To display all processes for a particular group :

2. ps -G [user_name]

Conclusion:

ps is a very useful command on Linux that you can use to manage processes on Linux. There’s still a lot to learn about the ps command, but this was just a use case. See the ps man page for additional learning material.

Happy learning


Written by 

Mayuri Dhote is a Software Consultant at Knoldus Software. She has completed her MCA from VIT University. She has very dedicated towards her work. She has always ready to learn new things. Her practice area is Devops. When not working, you will find her writing poems and poetry.

Discover more from Knoldus Blogs

Subscribe now to keep reading and get access to the full archive.

Continue reading