SlideShare a Scribd company logo
1 of 19
Download to read offline
Chapter 8Chapter 8
Process ManagementProcess Management
Ref. Pge. 85
What is a process?What is a process?
●
A binary commandA binary command
●
Loaded into memoryLoaded into memory
●
Processed by CPUProcessed by CPU
●
Release memory when quitRelease memory when quit
●
Identified by PIDIdentified by PID
Process TreeProcess Tree
●
Every process is generated by parentEvery process is generated by parent
processprocess
●
Child process inherits environmentChild process inherits environment
from it's parentfrom it's parent
●
Child process returns a value to parentChild process returns a value to parent
when exitwhen exit
●
TheThe initinit is the root of process treeis the root of process tree
Process EnvironmentProcess Environment
●
PID/PPIDPID/PPID
●
UID/GIDUID/GID
●
Command NameCommand Name
●
VariablesVariables
●
ParametersParameters
●
File DescriptorsFile Descriptors
●
Data ...Data ...
Process Management UtilitiesProcess Management Utilities
●
pstreepstree
– Shows the whole process treeShows the whole process tree
– Common optionsCommon options
●
­p­p : with PID: with PID
●
­u­u : with user name: with user name
Process Management UtilitiesProcess Management Utilities
●
psps
– Shows process informationShows process information
– Common options (standard style)Common options (standard style)
●
­l­l : long format: long format
●
­e­e : every process: every process
– Common options (BSD style)Common options (BSD style)
●
aa : all process related to terminal: all process related to terminal
●
uu : user format: user format
●
xx : current user's process / all process with option: current user's process / all process with option aa
●
ww : whole line information: whole line information
Ref. Pge. 86
Process Management UtilitiesProcess Management Utilities
●
toptop
– Sorts process in order (default by CPU usage)Sorts process in order (default by CPU usage)
– Common options:Common options:
●
­d ­d nn : delay in: delay in nn seconds intervalseconds interval
●
­n ­n nn : refresh: refresh nn timestimes
●
­b­b : batch mode in pipe line: batch mode in pipe line
Ref. Pge. 90
Process UtilitiesProcess Utilities
– Common internal commands ofCommon internal commands of toptop::
●
<space> <space>  : refresh screen: refresh screen
●
h,?h,? : help: help
●
ss : delay second: delay second
●
rr : renice a process: renice a process
●
kk : kill a process: kill a process
●
F,OF,O : select sorting field: select sorting field
●
ii : toggle idle processes: toggle idle processes
●
qq : quit: quit
Process Management UtilitiesProcess Management Utilities
●
uptimeuptime
– Displays system running informationDisplays system running information
Job ControlJob Control
●
Foreground JobForeground Job
– Normal way to run a commandNormal way to run a command
– The job occupies the terminal till finishThe job occupies the terminal till finish
– Parent process stay in sleep statusParent process stay in sleep status
– Can be stopped by pressingCan be stopped by pressing ctrl­zctrl­z
●
Background JobBackground Job
– Ending withEnding with && when running a commandwhen running a command
– The shell prompt occurred for typing nextThe shell prompt occurred for typing next
commandcommand
– Parent process is still runningParent process is still running
Ref. Pge. 92
UsingUsing jobsjobs
●
jobsjobs
– Displays all background jobs in current shellDisplays all background jobs in current shell
– Common options:Common options:
●
­l­l : display PID: display PID
Job Control SwitchingJob Control Switching
●
fgfg
– Bring a background/stopped job to foregroundBring a background/stopped job to foreground
●
^z^z
– Stop a foreground jobStop a foreground job
●
bgbg
– Put a stopped job to backgroundPut a stopped job to background
foreground
background
stopped
^Z
bg
fg
fg
Process PriorityProcess Priority
●
Processes have different priorities toProcesses have different priorities to
consume the CPU time slices in two ways:consume the CPU time slices in two ways:
– PRI (priority)PRI (priority)
●
Higher value has more CPU timeHigher value has more CPU time
●
Dynamic adjusted by kernelDynamic adjusted by kernel
– NI (nice)NI (nice)
●
Higher value has less CPU timeHigher value has less CPU time
●
Adjusted by user: -20~19Adjusted by user: -20~19
Ref. Pge. 93
UsingUsing nicenice
●
nice [­nice [­NINI] command_line] command_line
●
nice [­n nice [­n NINI] command_line] command_line
– Runs command with specifiedRuns command with specified NINI valuevalue
– The default value is 10The default value is 10
UsingUsing renicerenice
●
renice <renice <New_NINew_NI> PID ...> PID ...
– Adjusts the NI value for a process by PIDAdjusts the NI value for a process by PID
– Regular users can only increase NI valueRegular users can only increase NI value
– Regular users can only adjust owning processesRegular users can only adjust owning processes
●
renice <renice <New_NINew_NI> ­u > ­u useruser
– Adjusts the NI value for all processes owned byAdjusts the NI value for all processes owned by
specified userspecified user
– Root onlyRoot only
Process SignalProcess Signal
●
Change the status of a running processChange the status of a running process
●
Common signals:Common signals:
No. Name Function
1 HUP reload configuration
2 INT interrupt a process
3 QUIT quit with some actions
9 KILL terminated immediately
15 TERM terminated normally
18 CONT continue a stopped process
19 STP stop a process
Ref. Pge. 94
UsingUsing killkill
●
kill [­sig] <%JID/PID> …kill [­sig] <%JID/PID> …
– Sends a signal to processes or jobsSends a signal to processes or jobs
– The default signal isThe default signal is TERMTERM
– Signal formats:Signal formats:
●
­­nn : the signal number: the signal number
●
­­namename : the signal name: the signal name
UsingUsing killallkillall
●
killall [­sig] cmd_name …killall [­sig] cmd_name …
– Sends a signal to processes by nameSends a signal to processes by name
– All processes by the command receive the signalAll processes by the command receive the signal
– Regular users can only send signals to owningRegular users can only send signals to owning
processesprocesses

More Related Content

What's hot

Importance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation readingImportance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation readingKenny (netman)
 
Linux kernel debugging(ODP format)
Linux kernel debugging(ODP format)Linux kernel debugging(ODP format)
Linux kernel debugging(ODP format)yang firo
 
LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control GroupsMarian Marinov
 
LSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVMLSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVMMarian Marinov
 
Linux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingLinux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingKenny (netman)
 
Introduction of unit test on android kernel
Introduction of unit test on android kernelIntroduction of unit test on android kernel
Introduction of unit test on android kernelJohnson Chou
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storageMarian Marinov
 
PHP at Density and Scale (Lone Star PHP 2014)
PHP at Density and Scale (Lone Star PHP 2014)PHP at Density and Scale (Lone Star PHP 2014)
PHP at Density and Scale (Lone Star PHP 2014)David Timothy Strauss
 
Kernel Recipes 2015 - Porting Linux to a new processor architecture
Kernel Recipes 2015 - Porting Linux to a new processor architectureKernel Recipes 2015 - Porting Linux to a new processor architecture
Kernel Recipes 2015 - Porting Linux to a new processor architectureAnne Nicolas
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)shimosawa
 
Kernel Recipes 2015: Introduction to Kernel Power Management
Kernel Recipes 2015: Introduction to Kernel Power ManagementKernel Recipes 2015: Introduction to Kernel Power Management
Kernel Recipes 2015: Introduction to Kernel Power ManagementAnne Nicolas
 
Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Samsung Open Source Group
 

What's hot (20)

Importance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation readingImportance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation reading
 
Linux kernel debugging(ODP format)
Linux kernel debugging(ODP format)Linux kernel debugging(ODP format)
Linux kernel debugging(ODP format)
 
LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control Groups
 
LSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVMLSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVM
 
First steps on CentOs7
First steps on CentOs7First steps on CentOs7
First steps on CentOs7
 
SystemV vs systemd
SystemV vs systemdSystemV vs systemd
SystemV vs systemd
 
Linux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingLinux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job Scheduling
 
Introduction of unit test on android kernel
Introduction of unit test on android kernelIntroduction of unit test on android kernel
Introduction of unit test on android kernel
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storage
 
Systemd cheatsheet
Systemd cheatsheetSystemd cheatsheet
Systemd cheatsheet
 
PHP at Density and Scale (Lone Star PHP 2014)
PHP at Density and Scale (Lone Star PHP 2014)PHP at Density and Scale (Lone Star PHP 2014)
PHP at Density and Scale (Lone Star PHP 2014)
 
Kgdb kdb modesetting
Kgdb kdb modesettingKgdb kdb modesetting
Kgdb kdb modesetting
 
Kernel Recipes 2015 - Porting Linux to a new processor architecture
Kernel Recipes 2015 - Porting Linux to a new processor architectureKernel Recipes 2015 - Porting Linux to a new processor architecture
Kernel Recipes 2015 - Porting Linux to a new processor architecture
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
Linux: LVM
Linux: LVMLinux: LVM
Linux: LVM
 
Kernel Recipes 2015: Introduction to Kernel Power Management
Kernel Recipes 2015: Introduction to Kernel Power ManagementKernel Recipes 2015: Introduction to Kernel Power Management
Kernel Recipes 2015: Introduction to Kernel Power Management
 
Puppet
PuppetPuppet
Puppet
 
Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?
 
Haproxy - zastosowania
Haproxy - zastosowaniaHaproxy - zastosowania
Haproxy - zastosowania
 
4. storage lvm
4. storage   lvm4. storage   lvm
4. storage lvm
 

Viewers also liked

Viewers also liked (10)

Windows7 Vs Linux
Windows7 Vs LinuxWindows7 Vs Linux
Windows7 Vs Linux
 
Linux CLI
Linux CLILinux CLI
Linux CLI
 
The linux command line for total beginners
The linux command line  for total beginnersThe linux command line  for total beginners
The linux command line for total beginners
 
Linux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxLinux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regx
 
Linux fundamental - Chap 07 vi
Linux fundamental - Chap 07 viLinux fundamental - Chap 07 vi
Linux fundamental - Chap 07 vi
 
Linux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileLinux fundamental - Chap 03 file
Linux fundamental - Chap 03 file
 
Linux fundamental - Chap 13 account management
Linux fundamental - Chap 13 account managementLinux fundamental - Chap 13 account management
Linux fundamental - Chap 13 account management
 
Linux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filterLinux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filter
 
Linux fundamental - Chap 02 perm
Linux fundamental - Chap 02 permLinux fundamental - Chap 02 perm
Linux fundamental - Chap 02 perm
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 

Similar to Linux fundamental - Chap 08 proc

3.5 create, monitor and kill processes v2
3.5 create, monitor and kill processes v23.5 create, monitor and kill processes v2
3.5 create, monitor and kill processes v2Acácio Oliveira
 
Trevor McDonald - Nagios XI Under The Hood
Trevor McDonald  - Nagios XI Under The HoodTrevor McDonald  - Nagios XI Under The Hood
Trevor McDonald - Nagios XI Under The HoodNagios
 
3.6 modify process execution priorities v2
3.6 modify process execution priorities v23.6 modify process execution priorities v2
3.6 modify process execution priorities v2Acácio Oliveira
 
101 3.5 create, monitor and kill processes v2
101 3.5 create, monitor and kill processes v2101 3.5 create, monitor and kill processes v2
101 3.5 create, monitor and kill processes v2Acácio Oliveira
 
101 3.6 modify process execution priorities v2
101 3.6 modify process execution priorities v2101 3.6 modify process execution priorities v2
101 3.6 modify process execution priorities v2Acácio Oliveira
 
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios
 
DockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing AureaDockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing AureaŁukasz Piątkowski
 
OSMC 2014: Naemon 1, 2, 3, N | Andreas Ericsson
OSMC 2014: Naemon 1, 2, 3, N | Andreas EricssonOSMC 2014: Naemon 1, 2, 3, N | Andreas Ericsson
OSMC 2014: Naemon 1, 2, 3, N | Andreas EricssonNETWAYS
 
Replication using PostgreSQL Replicator
Replication using PostgreSQL ReplicatorReplication using PostgreSQL Replicator
Replication using PostgreSQL ReplicatorCommand Prompt., Inc
 
Exploring Raspberry Pi
Exploring Raspberry PiExploring Raspberry Pi
Exploring Raspberry PiLentin Joseph
 
Creating a mature puppet system
Creating a mature puppet systemCreating a mature puppet system
Creating a mature puppet systemrkhatibi
 
Creating a Mature Puppet System
Creating a Mature Puppet SystemCreating a Mature Puppet System
Creating a Mature Puppet SystemPuppet
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd Marian Marinov
 
Archivematica Technical Training Diagnostics Guide (September 2018)
Archivematica Technical Training Diagnostics Guide (September 2018)Archivematica Technical Training Diagnostics Guide (September 2018)
Archivematica Technical Training Diagnostics Guide (September 2018)Artefactual Systems - Archivematica
 
linux monitoring and performance tunning
linux monitoring and performance tunning linux monitoring and performance tunning
linux monitoring and performance tunning iman darabi
 

Similar to Linux fundamental - Chap 08 proc (20)

3.5 create, monitor and kill processes v2
3.5 create, monitor and kill processes v23.5 create, monitor and kill processes v2
3.5 create, monitor and kill processes v2
 
Trevor McDonald - Nagios XI Under The Hood
Trevor McDonald  - Nagios XI Under The HoodTrevor McDonald  - Nagios XI Under The Hood
Trevor McDonald - Nagios XI Under The Hood
 
3.6 modify process execution priorities v2
3.6 modify process execution priorities v23.6 modify process execution priorities v2
3.6 modify process execution priorities v2
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 
101 3.5 create, monitor and kill processes v2
101 3.5 create, monitor and kill processes v2101 3.5 create, monitor and kill processes v2
101 3.5 create, monitor and kill processes v2
 
101 3.6 modify process execution priorities v2
101 3.6 modify process execution priorities v2101 3.6 modify process execution priorities v2
101 3.6 modify process execution priorities v2
 
Pdf c1t tlawaxb
Pdf c1t tlawaxbPdf c1t tlawaxb
Pdf c1t tlawaxb
 
Process management
Process managementProcess management
Process management
 
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
 
DockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing AureaDockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing Aurea
 
OSMC 2014: Naemon 1, 2, 3, N | Andreas Ericsson
OSMC 2014: Naemon 1, 2, 3, N | Andreas EricssonOSMC 2014: Naemon 1, 2, 3, N | Andreas Ericsson
OSMC 2014: Naemon 1, 2, 3, N | Andreas Ericsson
 
Go replicator
Go replicatorGo replicator
Go replicator
 
Replication using PostgreSQL Replicator
Replication using PostgreSQL ReplicatorReplication using PostgreSQL Replicator
Replication using PostgreSQL Replicator
 
Exploring Raspberry Pi
Exploring Raspberry PiExploring Raspberry Pi
Exploring Raspberry Pi
 
Creating a mature puppet system
Creating a mature puppet systemCreating a mature puppet system
Creating a mature puppet system
 
Creating a Mature Puppet System
Creating a Mature Puppet SystemCreating a Mature Puppet System
Creating a Mature Puppet System
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd
 
Archivematica Technical Training Diagnostics Guide (September 2018)
Archivematica Technical Training Diagnostics Guide (September 2018)Archivematica Technical Training Diagnostics Guide (September 2018)
Archivematica Technical Training Diagnostics Guide (September 2018)
 
Optimizing Linux Servers
Optimizing Linux ServersOptimizing Linux Servers
Optimizing Linux Servers
 
linux monitoring and performance tunning
linux monitoring and performance tunning linux monitoring and performance tunning
linux monitoring and performance tunning
 

More from Kenny (netman)

rpi_audio configuration steps
rpi_audio configuration stepsrpi_audio configuration steps
rpi_audio configuration stepsKenny (netman)
 
Linux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System RescueLinux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System RescueKenny (netman)
 
Linux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell scriptLinux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell scriptKenny (netman)
 
Linux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellLinux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellKenny (netman)
 
Linux network monitoring hands-on pratice
Linux network monitoring hands-on praticeLinux network monitoring hands-on pratice
Linux network monitoring hands-on praticeKenny (netman)
 
Linux Network Monitoring
Linux Network MonitoringLinux Network Monitoring
Linux Network MonitoringKenny (netman)
 

More from Kenny (netman) (14)

rpi_audio configuration steps
rpi_audio configuration stepsrpi_audio configuration steps
rpi_audio configuration steps
 
Rpi audio
Rpi audioRpi audio
Rpi audio
 
Ha opensuse
Ha opensuseHa opensuse
Ha opensuse
 
Chap 18 net
Chap 18 netChap 18 net
Chap 18 net
 
About the Course
About the CourseAbout the Course
About the Course
 
Linux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System RescueLinux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System Rescue
 
Linux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell scriptLinux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell script
 
Linux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellLinux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shell
 
Linux system security
Linux system securityLinux system security
Linux system security
 
Linux network monitoring hands-on pratice
Linux network monitoring hands-on praticeLinux network monitoring hands-on pratice
Linux network monitoring hands-on pratice
 
Linux Network Monitoring
Linux Network MonitoringLinux Network Monitoring
Linux Network Monitoring
 
加密應用(GPG)
加密應用(GPG)加密應用(GPG)
加密應用(GPG)
 
金鑰管理 (PKI)
金鑰管理 (PKI)金鑰管理 (PKI)
金鑰管理 (PKI)
 
Linux firewall
Linux firewallLinux firewall
Linux firewall
 

Recently uploaded

Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Recently uploaded (20)

Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

Linux fundamental - Chap 08 proc

  • 1. Chapter 8Chapter 8 Process ManagementProcess Management Ref. Pge. 85
  • 2. What is a process?What is a process? ● A binary commandA binary command ● Loaded into memoryLoaded into memory ● Processed by CPUProcessed by CPU ● Release memory when quitRelease memory when quit ● Identified by PIDIdentified by PID
  • 3. Process TreeProcess Tree ● Every process is generated by parentEvery process is generated by parent processprocess ● Child process inherits environmentChild process inherits environment from it's parentfrom it's parent ● Child process returns a value to parentChild process returns a value to parent when exitwhen exit ● TheThe initinit is the root of process treeis the root of process tree
  • 4. Process EnvironmentProcess Environment ● PID/PPIDPID/PPID ● UID/GIDUID/GID ● Command NameCommand Name ● VariablesVariables ● ParametersParameters ● File DescriptorsFile Descriptors ● Data ...Data ...
  • 5. Process Management UtilitiesProcess Management Utilities ● pstreepstree – Shows the whole process treeShows the whole process tree – Common optionsCommon options ● ­p­p : with PID: with PID ● ­u­u : with user name: with user name
  • 6. Process Management UtilitiesProcess Management Utilities ● psps – Shows process informationShows process information – Common options (standard style)Common options (standard style) ● ­l­l : long format: long format ● ­e­e : every process: every process – Common options (BSD style)Common options (BSD style) ● aa : all process related to terminal: all process related to terminal ● uu : user format: user format ● xx : current user's process / all process with option: current user's process / all process with option aa ● ww : whole line information: whole line information Ref. Pge. 86
  • 7. Process Management UtilitiesProcess Management Utilities ● toptop – Sorts process in order (default by CPU usage)Sorts process in order (default by CPU usage) – Common options:Common options: ● ­d ­d nn : delay in: delay in nn seconds intervalseconds interval ● ­n ­n nn : refresh: refresh nn timestimes ● ­b­b : batch mode in pipe line: batch mode in pipe line Ref. Pge. 90
  • 8. Process UtilitiesProcess Utilities – Common internal commands ofCommon internal commands of toptop:: ● <space> <space>  : refresh screen: refresh screen ● h,?h,? : help: help ● ss : delay second: delay second ● rr : renice a process: renice a process ● kk : kill a process: kill a process ● F,OF,O : select sorting field: select sorting field ● ii : toggle idle processes: toggle idle processes ● qq : quit: quit
  • 9. Process Management UtilitiesProcess Management Utilities ● uptimeuptime – Displays system running informationDisplays system running information
  • 10. Job ControlJob Control ● Foreground JobForeground Job – Normal way to run a commandNormal way to run a command – The job occupies the terminal till finishThe job occupies the terminal till finish – Parent process stay in sleep statusParent process stay in sleep status – Can be stopped by pressingCan be stopped by pressing ctrl­zctrl­z ● Background JobBackground Job – Ending withEnding with && when running a commandwhen running a command – The shell prompt occurred for typing nextThe shell prompt occurred for typing next commandcommand – Parent process is still runningParent process is still running Ref. Pge. 92
  • 11. UsingUsing jobsjobs ● jobsjobs – Displays all background jobs in current shellDisplays all background jobs in current shell – Common options:Common options: ● ­l­l : display PID: display PID
  • 12. Job Control SwitchingJob Control Switching ● fgfg – Bring a background/stopped job to foregroundBring a background/stopped job to foreground ● ^z^z – Stop a foreground jobStop a foreground job ● bgbg – Put a stopped job to backgroundPut a stopped job to background
  • 14. Process PriorityProcess Priority ● Processes have different priorities toProcesses have different priorities to consume the CPU time slices in two ways:consume the CPU time slices in two ways: – PRI (priority)PRI (priority) ● Higher value has more CPU timeHigher value has more CPU time ● Dynamic adjusted by kernelDynamic adjusted by kernel – NI (nice)NI (nice) ● Higher value has less CPU timeHigher value has less CPU time ● Adjusted by user: -20~19Adjusted by user: -20~19 Ref. Pge. 93
  • 15. UsingUsing nicenice ● nice [­nice [­NINI] command_line] command_line ● nice [­n nice [­n NINI] command_line] command_line – Runs command with specifiedRuns command with specified NINI valuevalue – The default value is 10The default value is 10
  • 16. UsingUsing renicerenice ● renice <renice <New_NINew_NI> PID ...> PID ... – Adjusts the NI value for a process by PIDAdjusts the NI value for a process by PID – Regular users can only increase NI valueRegular users can only increase NI value – Regular users can only adjust owning processesRegular users can only adjust owning processes ● renice <renice <New_NINew_NI> ­u > ­u useruser – Adjusts the NI value for all processes owned byAdjusts the NI value for all processes owned by specified userspecified user – Root onlyRoot only
  • 17. Process SignalProcess Signal ● Change the status of a running processChange the status of a running process ● Common signals:Common signals: No. Name Function 1 HUP reload configuration 2 INT interrupt a process 3 QUIT quit with some actions 9 KILL terminated immediately 15 TERM terminated normally 18 CONT continue a stopped process 19 STP stop a process Ref. Pge. 94
  • 18. UsingUsing killkill ● kill [­sig] <%JID/PID> …kill [­sig] <%JID/PID> … – Sends a signal to processes or jobsSends a signal to processes or jobs – The default signal isThe default signal is TERMTERM – Signal formats:Signal formats: ● ­­nn : the signal number: the signal number ● ­­namename : the signal name: the signal name
  • 19. UsingUsing killallkillall ● killall [­sig] cmd_name …killall [­sig] cmd_name … – Sends a signal to processes by nameSends a signal to processes by name – All processes by the command receive the signalAll processes by the command receive the signal – Regular users can only send signals to owningRegular users can only send signals to owning processesprocesses