SlideShare a Scribd company logo
Lesson 10-Controlling User  Processes
Overview  Managing and processing processes. Managing jobs. Exiting/quitting when jobs have been stopped.
Managing and Processing Processes  Every running program is a separate entity, called a process. A process consists of several components working together, including the code, data, CPU activity, memory, input, output, and error handling.
Managing and Processing Processes  Each process involves reading instructions, accessing computer memory, reading from input, evaluating arguments, performing calculations, and writing to output. Every process on the system has its own unique process ID number.
Managing and Processing Processes  Obtaining detailed information on system processes. Identifying processes connected to a terminal. Starting a new shell process. Obtaining detailed data about user processes.
Genealogy of processes. Ending foreground processes. Ending background processes. Terminating a process that is not responding. Managing and Processing Processes
Obtaining Detailed Information on System Processes  The “ps –aux” and the “ps –ef” commands can be used to get a list of all processes currently running on the system. The “ps –u $USER” command can be used to list only the processes owned by a particular user. The “ps –u root” command can be used to list the processes that are started when the system is booted up, and that are owned by the root user.
Identifying Processes Connected to a Terminal  User processes must be informed of the port to which they are attached. The “tty” command can be used to determine the terminal port used by a user. The “ps –t port” command can be used to display the running processes, the shell, a process running sleep, and the process running the ps utility.
Identifying Processes Connected to a Terminal  Output of ps Utility
Identifying Processes Connected to a Terminal  PID – The PID, called the Process IDentification number, is a unique number assigned to each process when it gets created. CPU – It refers to the CPU time consumed by a process. CMD – The command mode contains the names of the utilities associated with each running process.
Starting a New Shell Process  The “sh” command is used to start a child shell. The “echo $$” command can be used to obtain the PID of the current shell. The “exit” command or the CTRL-D keys can be used to exit the child shell.
Obtaining Detailed Data about User Processes  Output of ps –l Command
Obtaining Detailed Data about User Processes  Flags (F) – This field contains a number indicating the Flags or options set for a process. State (S) – It indicates the state of the process, which includes sleeping (S), running (R), idle (I), and traced (T). Size (SZ) – It contains a number indicating the size of the process in memory. Command (CMD) – It refers to the actual command being run by the process.
Genealogy of Processes  Processes inherit data from their parent process. Every utility or executable file name that is typed is executed by a process that is a child of the shell process. The child process inherits data such as tty, user ID, and the current directory from the parent process.
Ending Foreground Processes  The “stty –a” command can be used to display the settings for a system. The “echo $?” and the “echo $status” commands can be used to ask for the exit status sent by the process running sleep to the shell. The “echo $?” command is used by the sh and the recent csh family shells.
Ending Foreground Processes  The “echo $status” command is used by the older csh family of shells. The CTRL-D key is used to mark the end-of-file character, while the CTRL-C key is used to interrupt a process. The CTRL-D key displays an output, but the CTRL-C does not generate any output.
Ending Foreground Processes  The keyboard signal “quit” can be used to stop a foreground process. The “CTRL-\” keys can also be used to quit a process. The quit signal destroys the process and sometimes makes a copy of the CPU memory associated with the process at the time of exit. The copy is called a core file.
Ending Background Processes  The “kill” command can be used to terminate a process running in the background. The command requires the PID of the process as the second argument. The “kill –l” command can be used to list all the kill signals available for the current system.
Ending Background Processes  Listing of All Signals
Terminating a Process that is not Responding  The following tasks should be carried out to terminate a process: A new terminal should be started. The current terminal port should be identified at the new login or terminal. All the processes should be listed. The PID of the particular process should be identified and the ‘kill’ command should be used to terminate it.
Managing Jobs  A command-line that instructs the shell to start several processes with the output from the first connecting to the second and so on, is called a job. All modern shells allow users to start, suspend, make active, and kill the processes associated with a job.
Managing Jobs  Suspending a job. Identifying the most recent job. Killing a particular job.
Suspending a Job  The “stty –a” command is used to describe a list of CTRL key settings used by the terminal and the shell for communication. The CTRL-Z key is used to suspend a job. The suspended job does not use the system memory. The “fg” command is used to bring the last suspended job into the foreground.
Suspending a Job  The “jobs” program lists all background and suspended jobs and their status. The “jobs” command is a shell built-in command. A job’s output is divided into four columns – the job number, the order, the status, and the command being executed.
Identifying the Most Recent Job  The “fg %+” is used to bring the most recently suspended job to the foreground. The “fg %-” is used to bring the second most recently suspended job to the foreground.
Identifying the Most Recent Job  The job number can also be used to get a job to the foreground. For example, “fg %2”, where %2 specifies the job with the job number 2. The job name can also be used to get a job to the foreground.
Killing a Job  The “kill %+” command is used to kill the most recent job in the job list. The job number can also be passed as an argument to kill that particular job. The job name can also be passed as an argument to kill a job. Care should be taken while killing a job. We must not kill wrong jobs.
Exiting/Quitting When Jobs Have Been Stopped  Job control is a very useful method of managing processes. UNIX job control provides a method of warning the users of stopped or running background jobs when an attempt is made to log out or exit a process. It logs out without warning when we issue the same command again, resulting in loss of unsaved data.
Summary  Programs running in a system are executed by a process that reads the appropriate code and accomplishes the tasks. All the processes have their own unique PID, the PID of their parent, an owner, group, memory, code, input, output, error, and their tty port.
A command-line that consists of one process or a series of processes connected by pipes is called a job. The kill command terminates processes identified by either their process ID or job number/job name. Summary

More Related Content

PDF
Unix system programming
PPT
intro unix/linux 03
PPT
intro unix/linux 08
PPT
intro unix/linux 06
ODP
intro unix/linux 02
PPT
intro unix/linux 04
PPT
intro unix/linux 05
PDF
Unix system programming
intro unix/linux 03
intro unix/linux 08
intro unix/linux 06
intro unix/linux 02
intro unix/linux 04
intro unix/linux 05

What's hot (20)

PPT
Spsl unit1
PDF
Unix practical file
PPT
Spsl by sasidhar 3 unit
PPTX
system management -shell programming by gaurav raikar
PPT
Unit 3
PDF
Summarized of UNIX Time Sharing System
PPT
Unit 7
PPT
Linux shell scripting
PDF
Complete Guide for Linux shell programming
DOC
58518522 study-aix
PPTX
Linux powerpoint
PPT
Linker scripts
PPTX
Bash shell scripting
PPT
PPTX
Piping into-php
ODP
PPTX
Systemcall1
PPTX
Bash Shell Scripting
PPT
Shell programming
PPTX
Unix - Filters/Editors
Spsl unit1
Unix practical file
Spsl by sasidhar 3 unit
system management -shell programming by gaurav raikar
Unit 3
Summarized of UNIX Time Sharing System
Unit 7
Linux shell scripting
Complete Guide for Linux shell programming
58518522 study-aix
Linux powerpoint
Linker scripts
Bash shell scripting
Piping into-php
Systemcall1
Bash Shell Scripting
Shell programming
Unix - Filters/Editors
Ad

Similar to intro unix/linux 10 (20)

PPTX
13 process management
PPTX
UNIX Notes
PPT
101 3.5 create, monitor and kill processes
PPTX
578781849-RHSA-1-Chap578781850-RHSA-1-Chapter-4ter-7.pptx
PDF
Unit 10 investigating and managing
PPTX
Processes
PPT
Processes And Job Control
DOCX
lec4.docx
PDF
Information about linux operating system
PPTX
System Administration: Linux Process
PPTX
Managing Processes in Unix.pptx
PPTX
Managing Processes in Unix.pptx
PDF
2.1.using the shell
PPT
PPT
3.5 create, monitor and kill processes v2
PPTX
unix- the process states, zombies, running jobs in background
PPT
11_UNIX_Processes_Including_Select.ppt
DOCX
Unix Project
PPTX
Presentation for RHCE in linux
PDF
Linux fundamental - Chap 08 proc
13 process management
UNIX Notes
101 3.5 create, monitor and kill processes
578781849-RHSA-1-Chap578781850-RHSA-1-Chapter-4ter-7.pptx
Unit 10 investigating and managing
Processes
Processes And Job Control
lec4.docx
Information about linux operating system
System Administration: Linux Process
Managing Processes in Unix.pptx
Managing Processes in Unix.pptx
2.1.using the shell
3.5 create, monitor and kill processes v2
unix- the process states, zombies, running jobs in background
11_UNIX_Processes_Including_Select.ppt
Unix Project
Presentation for RHCE in linux
Linux fundamental - Chap 08 proc
Ad

More from duquoi (12)

PDF
Troubleshooting CD Burning
PDF
Advanced Bash Scripting Guide 2002
PDF
Astrolog: Switches
PDF
Cinelerra Video Editing Manual
PDF
Iptables
PDF
Ffmpeg
ODP
rosegarden
PPT
intro unix/linux 12
PPT
intro unix/linux 11
PPT
intro unix/linux 09
PPT
intro unix/linux 07
PPT
intro unix/linux 01
Troubleshooting CD Burning
Advanced Bash Scripting Guide 2002
Astrolog: Switches
Cinelerra Video Editing Manual
Iptables
Ffmpeg
rosegarden
intro unix/linux 12
intro unix/linux 11
intro unix/linux 09
intro unix/linux 07
intro unix/linux 01

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Cloud computing and distributed systems.
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
cuic standard and advanced reporting.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
KodekX | Application Modernization Development
PDF
Empathic Computing: Creating Shared Understanding
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
MYSQL Presentation for SQL database connectivity
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Cloud computing and distributed systems.
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
cuic standard and advanced reporting.pdf
Big Data Technologies - Introduction.pptx
KodekX | Application Modernization Development
Empathic Computing: Creating Shared Understanding
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Modernizing your data center with Dell and AMD
Advanced methodologies resolving dimensionality complications for autism neur...
Chapter 3 Spatial Domain Image Processing.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
NewMind AI Monthly Chronicles - July 2025
CIFDAQ's Market Insight: SEC Turns Pro Crypto
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology

intro unix/linux 10

  • 2. Overview Managing and processing processes. Managing jobs. Exiting/quitting when jobs have been stopped.
  • 3. Managing and Processing Processes Every running program is a separate entity, called a process. A process consists of several components working together, including the code, data, CPU activity, memory, input, output, and error handling.
  • 4. Managing and Processing Processes Each process involves reading instructions, accessing computer memory, reading from input, evaluating arguments, performing calculations, and writing to output. Every process on the system has its own unique process ID number.
  • 5. Managing and Processing Processes Obtaining detailed information on system processes. Identifying processes connected to a terminal. Starting a new shell process. Obtaining detailed data about user processes.
  • 6. Genealogy of processes. Ending foreground processes. Ending background processes. Terminating a process that is not responding. Managing and Processing Processes
  • 7. Obtaining Detailed Information on System Processes The “ps –aux” and the “ps –ef” commands can be used to get a list of all processes currently running on the system. The “ps –u $USER” command can be used to list only the processes owned by a particular user. The “ps –u root” command can be used to list the processes that are started when the system is booted up, and that are owned by the root user.
  • 8. Identifying Processes Connected to a Terminal User processes must be informed of the port to which they are attached. The “tty” command can be used to determine the terminal port used by a user. The “ps –t port” command can be used to display the running processes, the shell, a process running sleep, and the process running the ps utility.
  • 9. Identifying Processes Connected to a Terminal Output of ps Utility
  • 10. Identifying Processes Connected to a Terminal PID – The PID, called the Process IDentification number, is a unique number assigned to each process when it gets created. CPU – It refers to the CPU time consumed by a process. CMD – The command mode contains the names of the utilities associated with each running process.
  • 11. Starting a New Shell Process The “sh” command is used to start a child shell. The “echo $$” command can be used to obtain the PID of the current shell. The “exit” command or the CTRL-D keys can be used to exit the child shell.
  • 12. Obtaining Detailed Data about User Processes Output of ps –l Command
  • 13. Obtaining Detailed Data about User Processes Flags (F) – This field contains a number indicating the Flags or options set for a process. State (S) – It indicates the state of the process, which includes sleeping (S), running (R), idle (I), and traced (T). Size (SZ) – It contains a number indicating the size of the process in memory. Command (CMD) – It refers to the actual command being run by the process.
  • 14. Genealogy of Processes Processes inherit data from their parent process. Every utility or executable file name that is typed is executed by a process that is a child of the shell process. The child process inherits data such as tty, user ID, and the current directory from the parent process.
  • 15. Ending Foreground Processes The “stty –a” command can be used to display the settings for a system. The “echo $?” and the “echo $status” commands can be used to ask for the exit status sent by the process running sleep to the shell. The “echo $?” command is used by the sh and the recent csh family shells.
  • 16. Ending Foreground Processes The “echo $status” command is used by the older csh family of shells. The CTRL-D key is used to mark the end-of-file character, while the CTRL-C key is used to interrupt a process. The CTRL-D key displays an output, but the CTRL-C does not generate any output.
  • 17. Ending Foreground Processes The keyboard signal “quit” can be used to stop a foreground process. The “CTRL-\” keys can also be used to quit a process. The quit signal destroys the process and sometimes makes a copy of the CPU memory associated with the process at the time of exit. The copy is called a core file.
  • 18. Ending Background Processes The “kill” command can be used to terminate a process running in the background. The command requires the PID of the process as the second argument. The “kill –l” command can be used to list all the kill signals available for the current system.
  • 19. Ending Background Processes Listing of All Signals
  • 20. Terminating a Process that is not Responding The following tasks should be carried out to terminate a process: A new terminal should be started. The current terminal port should be identified at the new login or terminal. All the processes should be listed. The PID of the particular process should be identified and the ‘kill’ command should be used to terminate it.
  • 21. Managing Jobs A command-line that instructs the shell to start several processes with the output from the first connecting to the second and so on, is called a job. All modern shells allow users to start, suspend, make active, and kill the processes associated with a job.
  • 22. Managing Jobs Suspending a job. Identifying the most recent job. Killing a particular job.
  • 23. Suspending a Job The “stty –a” command is used to describe a list of CTRL key settings used by the terminal and the shell for communication. The CTRL-Z key is used to suspend a job. The suspended job does not use the system memory. The “fg” command is used to bring the last suspended job into the foreground.
  • 24. Suspending a Job The “jobs” program lists all background and suspended jobs and their status. The “jobs” command is a shell built-in command. A job’s output is divided into four columns – the job number, the order, the status, and the command being executed.
  • 25. Identifying the Most Recent Job The “fg %+” is used to bring the most recently suspended job to the foreground. The “fg %-” is used to bring the second most recently suspended job to the foreground.
  • 26. Identifying the Most Recent Job The job number can also be used to get a job to the foreground. For example, “fg %2”, where %2 specifies the job with the job number 2. The job name can also be used to get a job to the foreground.
  • 27. Killing a Job The “kill %+” command is used to kill the most recent job in the job list. The job number can also be passed as an argument to kill that particular job. The job name can also be passed as an argument to kill a job. Care should be taken while killing a job. We must not kill wrong jobs.
  • 28. Exiting/Quitting When Jobs Have Been Stopped Job control is a very useful method of managing processes. UNIX job control provides a method of warning the users of stopped or running background jobs when an attempt is made to log out or exit a process. It logs out without warning when we issue the same command again, resulting in loss of unsaved data.
  • 29. Summary Programs running in a system are executed by a process that reads the appropriate code and accomplishes the tasks. All the processes have their own unique PID, the PID of their parent, an owner, group, memory, code, input, output, error, and their tty port.
  • 30. A command-line that consists of one process or a series of processes connected by pipes is called a job. The kill command terminates processes identified by either their process ID or job number/job name. Summary