SlideShare ist ein Scribd-Unternehmen logo
1 von 10
Process Management
Overview
• Each task in Unix starts a process.
• Each process is assigned a unique process identification
number (PID).
• Some processes are started by the system and are used
to control activities, these are usually called daemons
• Processes started by the user from the shell inherit the
shell’s terminal, and interact through it
• Processes started in the GUI don’t usually have a
terminal associated with them
Processes and PIDs
• Use the ‘ps’ command to list the processes currently
running on the system.
• The command is:
ps [options]
• Commonest options are -ef: (in some UNIXs aux)
– –e Every process on the system
– –f Full listing
• Use pgrep command to search for a specific process.
This is equivalent to ps –ef | grep
• Without options, ps will just print all processes that share
the terminal with it.
Processes and PIDs
• ‘ps’ can also print out resource usage information for all
processes on the system.
Example
$ ps aux | head
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 10348 732 ? Ss 2010 0:04 init [3]
apache 6019 0.0 0.8 241120 9184 ? S Jun26 0:01 /usr/sbin/httpd
root 6108 0.0 0.0 5908 620 ? Ss Mar30 0:16 syslogd -m 0
Process Life Line
• There are three stages in the process life cycle:
– Fork – the parent process creates an exact image of
itself in the memory and gets a new PID.
– Exec – the new process rewrites its image in the
memory and executes. The parent (i.e. shell) either
waits for the process to finish (foreground) or
continues to run (background)
– Termination – the child process returns a signal to the
parent, which contains an exit code. The parent
process deletes the child from the process table.
Signals
• UNIX systems use signals to communicate different
scenarios between processes
• The kernel manages signal transfers
• When a process receives a signal it stops its current
activity and moves to a signal handling routine
• Different signals have different default routines, which
can be overridden by the programmer
• Among other things signals terminate, suspend and
continue process.
• From a regular user perspective, most signals are
irrelevant – they are used by the kernel
Signaling with kill
• Use the command kill to send a signal to a process.
$ kill [-signal] %job-id|process-id
• The name is derived from the fact the default signal kill
sends is the SIGTERM (15) signal, which by default
terminates the process
• For a foreground process, ^C achieves the same result,
but it is actually the terminal sending a SIGINT (2) to the
process
• Both these signals can be blocked by the process (the
BASH, for example, blocks them)
• The signal SIGKILL (9) cannot be blocked, so if all else
fails, this is the way to destroy a stuck process
• ^Z sends the signal SIGTSTP, while SIGSTOP
is a non blocked equivalent
Cron
• The cron daemon continually checks the users crontab
files and execute periodic tasks
• Edit the user’s crontab with the command crontab –e
• An editor (usually vi) is opened with the crontab. The
table has six fields:
minute,hour,day,month,weekday,command
59,23,*,*,*, echo Hello > hello.$(date +%s)
• You can list your crontab with crontab –l
• In the system level, there is an additional mechanism of
crontabs for once-a-day, once-a-week, etc.
Monitoring processes by top
• ‘top’ - Displays the top processes on the system and
periodically updates the information.
• The first few lines of the display show general
information about the system’s state:
– Load averages in the last 1, 5, and 15 minutes.
– Existing processes no. and the no. of processes in
each state (sleeping, waiting, running, starting,
zombie, and stopped).
– Percentage of time spent in each of the processor
states (user, nice, system, idle, interrupt and
swapper) per processor on the system.
– Average value for each of the processor states (only
on multi-processor systems).
Monitoring processes by top – cont.
CPU Processor number on which the process is executing (only on multi-processor systems).
TTY Terminal interface used by the process
PID Process ID number
USERNAME Name of the owner of the process
PRI Current priority of the process
NI Nice value ranging from -20 to +20
SIZE Total size of the process in kilobytes.
RES Resident size of the process in kilobytes
STATE Current state of the process. The various states are sleep, wait, run, idle, zomb, or stop
TIME Number of system and CPU seconds the process has consumed
%WCPU Weighted CPU (central processing unit) percentage
%CPU Raw CPU percentage. This field is used to sort the top processes
COMMAND Name of the command the process is currently running

Weitere ähnliche Inhalte

Was ist angesagt?

Microprogram Control
Microprogram Control Microprogram Control
Microprogram Control
Anuj Modi
 
Presentiaon task sheduling first come first serve FCFS
Presentiaon  task sheduling first come first serve FCFSPresentiaon  task sheduling first come first serve FCFS
Presentiaon task sheduling first come first serve FCFS
Ahmed Salah
 
Microarchitecture
MicroarchitectureMicroarchitecture
Microarchitecture
meashi
 
Register Organization and Instruction cycle
Register Organization and Instruction cycleRegister Organization and Instruction cycle
Register Organization and Instruction cycle
Muhammad Ameer Mohavia
 
Os presentation process
Os presentation processOs presentation process
Os presentation process
Naseer Ahmad
 
Cpu scheduling algorithms simulation using java
Cpu scheduling algorithms simulation using javaCpu scheduling algorithms simulation using java
Cpu scheduling algorithms simulation using java
jsivasrinivas
 

Was ist angesagt? (20)

Priority scheduling algorithms
Priority scheduling algorithmsPriority scheduling algorithms
Priority scheduling algorithms
 
Program execution
Program executionProgram execution
Program execution
 
Process Control Block & Threads and Their Management
Process Control Block & Threads and Their ManagementProcess Control Block & Threads and Their Management
Process Control Block & Threads and Their Management
 
Introduction to Scheduling
Introduction to SchedulingIntroduction to Scheduling
Introduction to Scheduling
 
OPERATING SYSTEM-"Scheduling policies"
OPERATING SYSTEM-"Scheduling policies"OPERATING SYSTEM-"Scheduling policies"
OPERATING SYSTEM-"Scheduling policies"
 
Microprogram Control
Microprogram Control Microprogram Control
Microprogram Control
 
Presentiaon task sheduling first come first serve FCFS
Presentiaon  task sheduling first come first serve FCFSPresentiaon  task sheduling first come first serve FCFS
Presentiaon task sheduling first come first serve FCFS
 
Computer architecture control unit
Computer architecture control unitComputer architecture control unit
Computer architecture control unit
 
Linux System Monitoring basic commands
Linux System Monitoring basic commandsLinux System Monitoring basic commands
Linux System Monitoring basic commands
 
Microarchitecture
MicroarchitectureMicroarchitecture
Microarchitecture
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
 
Register Organization and Instruction cycle
Register Organization and Instruction cycleRegister Organization and Instruction cycle
Register Organization and Instruction cycle
 
Os presentation process
Os presentation processOs presentation process
Os presentation process
 
Ch7 official
Ch7 officialCh7 official
Ch7 official
 
Cpu scheduling algorithms simulation using java
Cpu scheduling algorithms simulation using javaCpu scheduling algorithms simulation using java
Cpu scheduling algorithms simulation using java
 
Micro Programmed Control Unit
Micro Programmed Control UnitMicro Programmed Control Unit
Micro Programmed Control Unit
 
3 4- computer organization and archietecture- COA- CO- Computer organization
3 4- computer organization and archietecture- COA- CO- Computer organization3 4- computer organization and archietecture- COA- CO- Computer organization
3 4- computer organization and archietecture- COA- CO- Computer organization
 
Operating system - Process and its concepts
Operating system - Process and its conceptsOperating system - Process and its concepts
Operating system - Process and its concepts
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
My ppt @ bec doms on process management
My ppt @ bec doms on process managementMy ppt @ bec doms on process management
My ppt @ bec doms on process management
 

Andere mochten auch (7)

Augusta Linux User Group - Vim Introduction
Augusta Linux User Group - Vim IntroductionAugusta Linux User Group - Vim Introduction
Augusta Linux User Group - Vim Introduction
 
Infra / Cont delivery - 3rd party automation
Infra / Cont delivery - 3rd party automationInfra / Cont delivery - 3rd party automation
Infra / Cont delivery - 3rd party automation
 
Unit3 browsing the filesystem
Unit3 browsing the filesystemUnit3 browsing the filesystem
Unit3 browsing the filesystem
 
14 network tools
14 network tools14 network tools
14 network tools
 
03 browsing the filesystem
03 browsing the filesystem03 browsing the filesystem
03 browsing the filesystem
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
chroot and SELinux
chroot and SELinuxchroot and SELinux
chroot and SELinux
 

Ähnlich wie 13 process management

Chapter 2 (Part 2)
Chapter 2 (Part 2) Chapter 2 (Part 2)
Chapter 2 (Part 2)
rohassanie
 
Operating System 3
Operating System 3Operating System 3
Operating System 3
tech2click
 

Ähnlich wie 13 process management (20)

UNIX Notes
UNIX NotesUNIX Notes
UNIX Notes
 
Advanced Operating Systems......Process Management
Advanced Operating Systems......Process ManagementAdvanced Operating Systems......Process Management
Advanced Operating Systems......Process Management
 
Operating System Structure Part-I.pdf
Operating System Structure Part-I.pdfOperating System Structure Part-I.pdf
Operating System Structure Part-I.pdf
 
Operating Systems
Operating Systems Operating Systems
Operating Systems
 
LP-Unit3.docx
LP-Unit3.docxLP-Unit3.docx
LP-Unit3.docx
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecture
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
Chapter 2 (Part 2)
Chapter 2 (Part 2) Chapter 2 (Part 2)
Chapter 2 (Part 2)
 
07 Systems Software Programming-IPC-Signals.pptx
07 Systems Software Programming-IPC-Signals.pptx07 Systems Software Programming-IPC-Signals.pptx
07 Systems Software Programming-IPC-Signals.pptx
 
Operating System 3
Operating System 3Operating System 3
Operating System 3
 
Course 102: Lecture 19: Using Signals
Course 102: Lecture 19: Using Signals Course 102: Lecture 19: Using Signals
Course 102: Lecture 19: Using Signals
 
Bedtime Stories on Operating Systems.pdf
Bedtime Stories on Operating Systems.pdfBedtime Stories on Operating Systems.pdf
Bedtime Stories on Operating Systems.pdf
 
Ch3 processes
Ch3   processesCh3   processes
Ch3 processes
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevels
 
OS Content.pdf
OS Content.pdfOS Content.pdf
OS Content.pdf
 
OS (1).pptx
OS (1).pptxOS (1).pptx
OS (1).pptx
 
Operating system 18 process creation and termination
Operating system 18 process creation and terminationOperating system 18 process creation and termination
Operating system 18 process creation and termination
 
Lecture5
Lecture5Lecture5
Lecture5
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
 

Mehr von Shay Cohen (14)

Linux Performance Tunning Memory
Linux Performance Tunning MemoryLinux Performance Tunning Memory
Linux Performance Tunning Memory
 
Linux Performance Tunning Kernel
Linux Performance Tunning KernelLinux Performance Tunning Kernel
Linux Performance Tunning Kernel
 
Linux Performance Tunning introduction
Linux Performance Tunning introductionLinux Performance Tunning introduction
Linux Performance Tunning introduction
 
12 linux archiving tools
12 linux archiving tools12 linux archiving tools
12 linux archiving tools
 
11 linux filesystem copy
11 linux filesystem copy11 linux filesystem copy
11 linux filesystem copy
 
10 finding files
10 finding files10 finding files
10 finding files
 
08 text processing_tools
08 text processing_tools08 text processing_tools
08 text processing_tools
 
07 vi text_editor
07 vi text_editor07 vi text_editor
07 vi text_editor
 
06 users groups_and_permissions
06 users groups_and_permissions06 users groups_and_permissions
06 users groups_and_permissions
 
05 standard io_and_pipes
05 standard io_and_pipes05 standard io_and_pipes
05 standard io_and_pipes
 
04 using and_configuring_bash
04 using and_configuring_bash04 using and_configuring_bash
04 using and_configuring_bash
 
02 linux desktop usage
02 linux desktop usage02 linux desktop usage
02 linux desktop usage
 
09 string processing_with_regex copy
09 string processing_with_regex copy09 string processing_with_regex copy
09 string processing_with_regex copy
 
01 linux history overview
01 linux history overview01 linux history overview
01 linux history overview
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

13 process management

  • 2. Overview • Each task in Unix starts a process. • Each process is assigned a unique process identification number (PID). • Some processes are started by the system and are used to control activities, these are usually called daemons • Processes started by the user from the shell inherit the shell’s terminal, and interact through it • Processes started in the GUI don’t usually have a terminal associated with them
  • 3. Processes and PIDs • Use the ‘ps’ command to list the processes currently running on the system. • The command is: ps [options] • Commonest options are -ef: (in some UNIXs aux) – –e Every process on the system – –f Full listing • Use pgrep command to search for a specific process. This is equivalent to ps –ef | grep • Without options, ps will just print all processes that share the terminal with it.
  • 4. Processes and PIDs • ‘ps’ can also print out resource usage information for all processes on the system. Example $ ps aux | head USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 10348 732 ? Ss 2010 0:04 init [3] apache 6019 0.0 0.8 241120 9184 ? S Jun26 0:01 /usr/sbin/httpd root 6108 0.0 0.0 5908 620 ? Ss Mar30 0:16 syslogd -m 0
  • 5. Process Life Line • There are three stages in the process life cycle: – Fork – the parent process creates an exact image of itself in the memory and gets a new PID. – Exec – the new process rewrites its image in the memory and executes. The parent (i.e. shell) either waits for the process to finish (foreground) or continues to run (background) – Termination – the child process returns a signal to the parent, which contains an exit code. The parent process deletes the child from the process table.
  • 6. Signals • UNIX systems use signals to communicate different scenarios between processes • The kernel manages signal transfers • When a process receives a signal it stops its current activity and moves to a signal handling routine • Different signals have different default routines, which can be overridden by the programmer • Among other things signals terminate, suspend and continue process. • From a regular user perspective, most signals are irrelevant – they are used by the kernel
  • 7. Signaling with kill • Use the command kill to send a signal to a process. $ kill [-signal] %job-id|process-id • The name is derived from the fact the default signal kill sends is the SIGTERM (15) signal, which by default terminates the process • For a foreground process, ^C achieves the same result, but it is actually the terminal sending a SIGINT (2) to the process • Both these signals can be blocked by the process (the BASH, for example, blocks them) • The signal SIGKILL (9) cannot be blocked, so if all else fails, this is the way to destroy a stuck process • ^Z sends the signal SIGTSTP, while SIGSTOP is a non blocked equivalent
  • 8. Cron • The cron daemon continually checks the users crontab files and execute periodic tasks • Edit the user’s crontab with the command crontab –e • An editor (usually vi) is opened with the crontab. The table has six fields: minute,hour,day,month,weekday,command 59,23,*,*,*, echo Hello > hello.$(date +%s) • You can list your crontab with crontab –l • In the system level, there is an additional mechanism of crontabs for once-a-day, once-a-week, etc.
  • 9. Monitoring processes by top • ‘top’ - Displays the top processes on the system and periodically updates the information. • The first few lines of the display show general information about the system’s state: – Load averages in the last 1, 5, and 15 minutes. – Existing processes no. and the no. of processes in each state (sleeping, waiting, running, starting, zombie, and stopped). – Percentage of time spent in each of the processor states (user, nice, system, idle, interrupt and swapper) per processor on the system. – Average value for each of the processor states (only on multi-processor systems).
  • 10. Monitoring processes by top – cont. CPU Processor number on which the process is executing (only on multi-processor systems). TTY Terminal interface used by the process PID Process ID number USERNAME Name of the owner of the process PRI Current priority of the process NI Nice value ranging from -20 to +20 SIZE Total size of the process in kilobytes. RES Resident size of the process in kilobytes STATE Current state of the process. The various states are sleep, wait, run, idle, zomb, or stop TIME Number of system and CPU seconds the process has consumed %WCPU Weighted CPU (central processing unit) percentage %CPU Raw CPU percentage. This field is used to sort the top processes COMMAND Name of the command the process is currently running

Hinweis der Redaktion

  1. Each task you perform in the Unix environment starts a process. An example of a process is using vi to edit a text file, or sending file to a printer. Each process is assigned a unique process identification number (PID), which is used by the system to identify the process.The following chapter defines useful commands to handle processes.
  2. Example:$ ps –ef | more UID PID PPID C STIME TTY TIME CMDroot 0 0 0 Dec 19 ? 0:01 sched root 1 0 0 Dec 19 ? 0:11 /etc/init - root 2 0 0 Dec 19 ? 0:00 pageout root 3 0 0 Dec 19 ? 201:03 fsflush root 126 1 0 Dec 19 ? 0:00 /usr/lib/netsvc/yp/ypxfrd root 322 1 0 Dec 19 ? 0:00 /usr/lib/saf/sac -t 300root 104 1 0 Dec 19 ? 2:34 /usr/sbin/rpcbind root 118 116 0 Dec 19 ? 1:01 rpc.nisd_resolv -F -C 8 -p 1073741824 -t udp root 106 1 0 Dec 19 ? 0:00 /usr/sbin/keyservroot 304 1 0 Dec 19 ? 0:00 /usr/sbin/rpld -a root 116 1 0 Dec 19 ? 7:46 /usr/lib/netsvc/yp/ypserv -d root 123 1 0 Dec 19 ? 0:03 /usr/lib/netsvc/yp/ypbind root 133 1 0 Dec 19 ? 0:00 /usr/lib/netsvc/yp/rpc.ypupdated--More— 
  3. Example:$ ps –ef | more UID PID PPID C STIME TTY TIME CMDroot 0 0 0 Dec 19 ? 0:01 sched root 1 0 0 Dec 19 ? 0:11 /etc/init - root 2 0 0 Dec 19 ? 0:00 pageout root 3 0 0 Dec 19 ? 201:03 fsflush root 126 1 0 Dec 19 ? 0:00 /usr/lib/netsvc/yp/ypxfrd root 322 1 0 Dec 19 ? 0:00 /usr/lib/saf/sac -t 300root 104 1 0 Dec 19 ? 2:34 /usr/sbin/rpcbind root 118 116 0 Dec 19 ? 1:01 rpc.nisd_resolv -F -C 8 -p 1073741824 -t udp root 106 1 0 Dec 19 ? 0:00 /usr/sbin/keyservroot 304 1 0 Dec 19 ? 0:00 /usr/sbin/rpld -a root 116 1 0 Dec 19 ? 7:46 /usr/lib/netsvc/yp/ypserv -d root 123 1 0 Dec 19 ? 0:03 /usr/lib/netsvc/yp/ypbind root 133 1 0 Dec 19 ? 0:00 /usr/lib/netsvc/yp/rpc.ypupdated--More— 
  4. When a new command is issued in the shell, a new process starts. The first stage of a new process is when the parent process (the shell in our example) creates an exact copy of itself in the memory. The new process (the child process) has the exact environment as the parent process, but it has a different PID. This act of creating an exact copy of the parent process in the memory is called fork.In the next stage, the child process rewrites its image in the memory with the image of the command it should run. Once the image of the new process is in the memory – the new command starts to execute.This stage is called exec.After the command finishes, it terminates. Before the command terminates completely, its parent process should acknowledge its termination. The parent process receives from the child process the exit code (or an indication why the child was killed, if the child did not exit voluntarily) and is responsible for deleting the child from the process table. 
  5. There are 46 signals in the Unix operating systems. Each signal is associated with a number and a name. Information on the different signals can be found by using the following command:$ man –s 5 signal The kill command sends a signal to a process. By doing this the kill command enables terminating unwanted command processes. It is useful when there is a need to stop a command that takes a long time to run, or when there is a need to terminate a process that you can not quit in the normal way.In order to send a signal to a process, it’s PID has to be known. Use the ps command to get the PID. After finding the process PID, type kill followed by the PID.If you use the kill command without specifying a signal, signal 15 (SIGTERM) is sent to the process with the specified PID number. This usually causes the process to terminate.Example:$ ps -u userd1 PID TTY TIME CMD 25190 pts/0 0:02 ls 25083 pts/0 0:00 ksh$ kill 25190$ jobs[1] + Terminated ls -R / > /dev/null 2>&1 &$ Use the –u option of the ps command to find the processes that the user userd1 is running. Then the ls command is terminated with the kill command. If you need to forcibly terminate a process, you can append the –9 option to the kill command. This option is necessary for killing shells which do not respond to any other signal to terminate.Command format:$ kill –9 pid WARNING – For processes other then shell, use kill –9 command as a last resort because it is an abrupt method and does not allow for proper process termination. To abort a background job, use the specific job number as an argument to the kill command:$ jobs[1] + Running ls -R / > /dev/null 2>&1 &$$$ kill %1[1] + Terminated ls -R / > /dev/null 2>&1 &$ The pkill command works exactly like the pgrep command, except that it terminates the matching process or processes with a kill signal:$ ls -R / > /dev/null 2>&1 &[1] 25387$ $ pkill ls$ jobs[1] + Terminated ls -R / > /dev/null 2>&1 &$