Check processes that are not associated with a terminal
Run command ps separated with option -a to see the processes which are not associated with the terminal on a Linux Machine.
Shell Script :
#!/bin/bash function ProCheck() { ps -a } ProCheck()
Output :
Shell Scripting – How to view Processes?
In this article, let’s explore how we can view current processes running on a Linux Server.
Linux machine gives users the option of multitasking hence naturally there will be multiple processes running on a session and also these processes are important fundamental components of Linux OS, Hence System Administrators may need to be aware of all processes and on what terminals they are running. For getting the list of all processes running on the machine, Linux gave a utility called ps, which provides the information of processes running on the Machine, here ps stands for Process Status.
Syntax :
ps {options}
The outcome generated by the ps command contains 3 fields namely :
- PID: This is the unique id associated with each process.
- TTY: This Value defines the type of terminal the user is using.
- CMD: This value defines the name of the command by which the process got launched.
Now let us see different types of ps commands that can be executed on a Linux Server with running example scripts running those commands.