Process Management in Linux :-
Process is defined as an instance of execution that runs on a processor, the process uses any resources that the Linux kernel can handle with. init is the first process in Linux. Every process will have a unique process ids.Which can be used to manage the processes. Parent Process is a process which creates another process, and the process which got start by another process is called child process. A process for which the parent process got killed is called orphan process.
A process may be in any of the following states.
Running Mode -> Running in foreground
Sleeping Mode -> Running in background
Uninterruptable sleep -> Waiting for the resource
Zombie process -> A process for which child process got killed without any exit status
Terminated -> Stopped
Job :-
A running process is called job when it is used in conjunction with job control A job may be running either in foreground or in background.A foreground job can takeinput and provide output.while a background job can't take input
Commands
ps Show currently running process
-e Show all processes
-u <user> Process by user
-F Give a detailed report
-H show process hierarchy
-o Options
pid Process id
comm Command
%cpu CPU usage
%mem Memory usage
state State of process
tty Terminal in which process is running
nice nice vale of the process(more the nice value lesser the priority) pstree Display a tree of processes pgrep <process> Search for the process
killing a process kill <pid>
-9 Kill forcefully
-15 Kill gracefully
jobs Display running job
kill %<job id> Kill job eith given id
fg %<job id> Bring the job to foreground
bg %<job id> Send the job to background
ctrl+c interrupting job
ctrl+z Terminate the process
Process is defined as an instance of execution that runs on a processor, the process uses any resources that the Linux kernel can handle with. init is the first process in Linux. Every process will have a unique process ids.Which can be used to manage the processes. Parent Process is a process which creates another process, and the process which got start by another process is called child process. A process for which the parent process got killed is called orphan process.
A process may be in any of the following states.
Running Mode -> Running in foreground
Sleeping Mode -> Running in background
Uninterruptable sleep -> Waiting for the resource
Zombie process -> A process for which child process got killed without any exit status
Terminated -> Stopped
Job :-
A running process is called job when it is used in conjunction with job control A job may be running either in foreground or in background.A foreground job can takeinput and provide output.while a background job can't take input
Commands
ps Show currently running process
-e Show all processes
-u <user> Process by user
-F Give a detailed report
-H show process hierarchy
-o Options
pid Process id
comm Command
%cpu CPU usage
%mem Memory usage
state State of process
tty Terminal in which process is running
nice nice vale of the process(more the nice value lesser the priority) pstree Display a tree of processes pgrep <process> Search for the process
killing a process kill <pid>
-9 Kill forcefully
-15 Kill gracefully
jobs Display running job
kill %<job id> Kill job eith given id
fg %<job id> Bring the job to foreground
bg %<job id> Send the job to background
ctrl+c interrupting job
ctrl+z Terminate the process