Investigating And Managing Processes in Linux
In Linux the program that is running constitutes a process. In Linux two numbers are assigned to a process i.e.
- 1. PID (Process ID):-
The process ID is assigned by a Linux Kernel and will be unique.
- 2. JID (Job ID):-
The Job ID is assigned by shell and will be unique. Here again a concept a parent and child shell will be assigned and each will have its unique JOB ID in its own category.
Following command can be used in respect with processes on Linux:-
- The command used to check the processes running in a current shell is
# ps
So it initially after you login you enter the ps command than it will show you the bash shell that you are running since you initiated it.
- But there are processes which are running even before you login in to your account. These processes are not linked with the terminal an example of it can be send mail. You can check these processes by using “ps –ef” command an example of it is
#ps –ef | grep –i sendmail
ps-ef is already explained, (|) is used to display content page wise, “grep” is used to match the keyword here and sendmail is the process whose details we want to use.
If you simply use ps –ef command than it will list all the processes running independent of the terminal.
- If you just want to check the process ID without much details you can use “pidof” command.
#pidof sendmail
