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:
Common ps option available:
- 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:
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.
ps aux| less
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.
Display process by the command name :
Processes can be selected based on command names :
- ps -c [cmd name]
Display all processes for a user or a group
To display all processes for a particular user :
- ps -U [user_name]
To display all processes for a particular group :
2. ps -G [user_name]
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.