SlideShare a Scribd company logo
Junior Level Linux Certification
Exam Objectives
Key Knowledge Areas
Run jobs in the foreground and background.
Signal a program to continue running after logout.
Monitor active processes.
Select and sort processes for display.
Send signals to processes.
Objective 3: GNU and Unix Commands
Create, monitor and kill processes Weight: 4
Terms and Utilities
& bg
fg jobs
kill nohup
ps top
free uptime
killall
2
Create, monitor and kill processes
Job control - Ability to selectively suspend execution of processes and continue their execution later.
A job is a process or a pipeline of processes that were started by the shell.
Job control
3
job which receives keyboard input is called the foreground job.
•When a foreground process is running, it receives keyboard input and signals.
•Processes started are run in foreground by default and continue until they exit.
To run a process in background – input command followed by special character &
•Processes running in the background may still send output to the terminal.
•They do not receive keyboard input unless they are brought to the foreground.
When bash starts a background job, it prints a line with:
- job number and - process ID of last process in pipeline
Create, monitor and kill processes
Job control - Ability to selectively suspend execution of processes and continue their execution later.
A job is a process or a pipeline of processes that were started by the shell.
Job control
4
job which receives keyboard input is called the foreground job.
•When a foreground process is running, it receives keyboard input and signals.
•Processes started are run in foreground by default and continue until they exit.
To run a process in background – input command followed by special character &
•Processes running in the background may still send output to the terminal.
•They do not receive keyboard input unless they are brought to the foreground.
When bash starts a background job, it prints a line with:
- job number and - process ID of last process in pipeline
Create, monitor and kill processes
command jobs displays current list of jobs either running or stopped.
jobs
5
foo:~ $ dd if=/dev/zero of=/dev/null bs=1 &
[1] 1181
foo:~ $ cat /dev/urandom | grep hello &
[2] 1183
foo:~ $ jobs
[1]- Running dd if=/dev/zero of=/dev/null bs=1 &
[2]+ Running cat /dev/urandom | grep hello &
Ex:
Create, monitor and kill processes
Control jobs
6
key sequences entered to foreground processes:
Key Signal Meaning Usage
Ctrl+C SIGINT Interrupt Interrupt the program running in the foreground
Ctrl+Z SIGSTOP Suspend Suspend the program running in the foreground
cmds entered to control background processes.
Command Meaning Usage
fg foreground Run the background job in the foreground. If it has suspended, restart it.
bg background Restart a suspended job.
fg makes most recently executed job a foreground job.
You can specify a specific job number. (Ex. fg 2 will make job 2 run in the foreground)
bg makes most recently executed job continue to run in background.
You can make a specific job run in the background by specifying a job number (Ex. bg 2)
Create, monitor and kill processes
Control jobs
7
kill command
kill job based on job number (instead of PID) using percentage sign to specify the job number
foo:~ $ jobs
[1]- Running dd if=/dev/zero of=/dev/null bs=1 &
[2]+ Running cat /dev/urandom | grep hello &
foo:~ $ kill %1
foo:~ $
[1]- Terminated dd if=/dev/zero of=/dev/null bs=1
foo:~ $ jobs
[2]+ Running cat /dev/urandom | grep hello &
foo:~ $ kill %2
foo:~ $
[2]+ Terminated cat /dev/urandom | grep hello
Ex:
Create, monitor and kill processes
Disconnected processes
8
commands nohup and setsid
- used to run processes disconnected from terminal that started them.
nohup sets the signal mask for the process it starts to ignore the SIGHUP signal.
SIGHUP signal is sent to each process when the shell exits. - happens when you exit a session on console, or via network connection.
•nohup writes the output to a file - nohup.out
•nohup is generally used - When you know that the process you are going to run should continue to
run after your session ends.
Create, monitor and kill processes
Monitoring processes
9
ps – process status
options supported by ps are somewhat complex.
GNU version supports: Unix98 options (letters); BSD options (dash); GNU options (two dashes).
To ... Unix98 BSD
- Show all processes ps -ax ps -A ps -e
- Show full info ps -u (user format) ps -f (full listing)
- Show full info for all processes ps -uax ps -ef ps -Af
foo:~ $ ps -f
UID PID PPID C STIME TTY TIME CMD
georgem 987 612 0 20:32 pts/2 00:00:00 /bin/bash
georgem 3398 987 0 21:11 pts/2 00:00:00 ps -f
foo:~ $ ps u
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
georgem 987 0.0 1.7 4676 2040 pts/2 S 20:32 0:00 /bin/bash
georgem 3399 0.0 0.5 2524 696 pts/2 R 21:11 0:00 ps u
Ex:
ps -w – display in wide format
ps -f – display in forest of processes, similar to output of pstree.
Create, monitor and kill processes
Monitoring processes
10
top – displays processes that use up the most CPU or memory.
Ex:
Create, monitor and kill processes
Signals
11
Processes in Linux do not communicate with each other directly, but send each other signals
via kernel.
most common signal sent is SIGTERM,
means Terminate, unless you know what to do
signal(7) man page.
Ex:
http://linux.about.com/od/commands/l/blcmdl7_signal.htm
Fim de sessão
12

More Related Content

PPT
101 3.2 process text streams using filters
PPT
101 3.4 use streams, pipes and redirects
PPT
101 1.3 runlevels , shutdown, and reboot
PPT
101 4.2 maintain the integrity of filesystems
PDF
Unit 10 investigating and managing
DOCX
50 most frequently used unix
DOCX
50 Most Frequently Used UNIX Linux Commands -hmftj
PPT
3.2 process text streams using filters
101 3.2 process text streams using filters
101 3.4 use streams, pipes and redirects
101 1.3 runlevels , shutdown, and reboot
101 4.2 maintain the integrity of filesystems
Unit 10 investigating and managing
50 most frequently used unix
50 Most Frequently Used UNIX Linux Commands -hmftj
3.2 process text streams using filters

What's hot (20)

PPT
101 4.1 create partitions and filesystems
PPT
101 3.2 process text streams using filters
PPT
101 3.2 process text streams using filters
DOCX
Unix system calls
ODP
PDF
Linux Network commands
DOCX
Perf stat windows
PPT
Unix(introduction)
DOCX
lec4.docx
PDF
Linux System Monitoring basic commands
PPT
Linux monitoring and Troubleshooting for DBA's
PPTX
Linux powerpoint
DOCX
Linux basic commands
PDF
Course 102: Lecture 17: Process Monitoring
DOCX
Linux final exam
PDF
Slide lpi mudancas lpic1
PPTX
Piping into-php
DOC
Unix Basics For Testers
PPT
Linux Troubleshooting
PDF
Linux Commands - Cheat Sheet
101 4.1 create partitions and filesystems
101 3.2 process text streams using filters
101 3.2 process text streams using filters
Unix system calls
Linux Network commands
Perf stat windows
Unix(introduction)
lec4.docx
Linux System Monitoring basic commands
Linux monitoring and Troubleshooting for DBA's
Linux powerpoint
Linux basic commands
Course 102: Lecture 17: Process Monitoring
Linux final exam
Slide lpi mudancas lpic1
Piping into-php
Unix Basics For Testers
Linux Troubleshooting
Linux Commands - Cheat Sheet
Ad

Similar to 101 3.5 create, monitor and kill processes (20)

DOCX
InstructionsInstructions for numberguessernumberGuesser.html.docx
PPT
3.5 create, monitor and kill processes v2
PPTX
Ultimate Unix Meetup Presentation
DOCX
LP-Unit3.docx
PPTX
Process managment
PPT
101 3.5 create, monitor and kill processes v2
PPTX
System Administration: Linux Process
PPTX
unix- the process states, zombies, running jobs in background
PPT
Processes And Job Control
ODP
operating system (process)
PPT
intro unix/linux 10
PPTX
Ultimate Unix Meetup Presentation
PPTX
Process management in linux
PDF
OS_lab_file.pdf
PPTX
578781849-RHSA-1-Chap578781850-RHSA-1-Chapter-4ter-7.pptx
PPT
Linux commands part3
PPTX
Working with clusters, shell profiles, UNIX extras..pptx
PDF
Operating System Practice : Meeting 6- process and manajemen proces-b-slide
PPT
ShellAdvanced aaäaaaaaaaaaaaaaaaaaaaaaaaaaaa
DOCX
Basic command for linux
InstructionsInstructions for numberguessernumberGuesser.html.docx
3.5 create, monitor and kill processes v2
Ultimate Unix Meetup Presentation
LP-Unit3.docx
Process managment
101 3.5 create, monitor and kill processes v2
System Administration: Linux Process
unix- the process states, zombies, running jobs in background
Processes And Job Control
operating system (process)
intro unix/linux 10
Ultimate Unix Meetup Presentation
Process management in linux
OS_lab_file.pdf
578781849-RHSA-1-Chap578781850-RHSA-1-Chapter-4ter-7.pptx
Linux commands part3
Working with clusters, shell profiles, UNIX extras..pptx
Operating System Practice : Meeting 6- process and manajemen proces-b-slide
ShellAdvanced aaäaaaaaaaaaaaaaaaaaaaaaaaaaaa
Basic command for linux
Ad

More from Acácio Oliveira (20)

PPTX
Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptx
PPTX
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptx
PPTX
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptx
PPTX
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptx
PPTX
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptx
PPTX
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptx
PPTX
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptx
PPTX
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptx
PPTX
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptx
PPTX
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptx
PPTX
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptx
PPTX
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....
PPTX
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptx
PPTX
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptx
PPTX
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...
PPTX
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptx
PPTX
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptx
PPTX
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptx
PPTX
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptx
PPTX
Security+ Lesson 01 Topic 17 - Types of Malware.pptx
Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptx
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptx
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptx
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptx
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptx
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptx
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptx
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptx
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptx
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptx
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptx
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptx
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptx
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptx
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptx
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptx
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptx
Security+ Lesson 01 Topic 17 - Types of Malware.pptx

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Machine learning based COVID-19 study performance prediction
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Modernizing your data center with Dell and AMD
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Review of recent advances in non-invasive hemoglobin estimation
Advanced methodologies resolving dimensionality complications for autism neur...
Unlocking AI with Model Context Protocol (MCP)
20250228 LYD VKU AI Blended-Learning.pptx
NewMind AI Monthly Chronicles - July 2025
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Dropbox Q2 2025 Financial Results & Investor Presentation
MYSQL Presentation for SQL database connectivity
Digital-Transformation-Roadmap-for-Companies.pptx
Machine learning based COVID-19 study performance prediction
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Modernizing your data center with Dell and AMD
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

101 3.5 create, monitor and kill processes

  • 1. Junior Level Linux Certification
  • 2. Exam Objectives Key Knowledge Areas Run jobs in the foreground and background. Signal a program to continue running after logout. Monitor active processes. Select and sort processes for display. Send signals to processes. Objective 3: GNU and Unix Commands Create, monitor and kill processes Weight: 4 Terms and Utilities & bg fg jobs kill nohup ps top free uptime killall 2
  • 3. Create, monitor and kill processes Job control - Ability to selectively suspend execution of processes and continue their execution later. A job is a process or a pipeline of processes that were started by the shell. Job control 3 job which receives keyboard input is called the foreground job. •When a foreground process is running, it receives keyboard input and signals. •Processes started are run in foreground by default and continue until they exit. To run a process in background – input command followed by special character & •Processes running in the background may still send output to the terminal. •They do not receive keyboard input unless they are brought to the foreground. When bash starts a background job, it prints a line with: - job number and - process ID of last process in pipeline
  • 4. Create, monitor and kill processes Job control - Ability to selectively suspend execution of processes and continue their execution later. A job is a process or a pipeline of processes that were started by the shell. Job control 4 job which receives keyboard input is called the foreground job. •When a foreground process is running, it receives keyboard input and signals. •Processes started are run in foreground by default and continue until they exit. To run a process in background – input command followed by special character & •Processes running in the background may still send output to the terminal. •They do not receive keyboard input unless they are brought to the foreground. When bash starts a background job, it prints a line with: - job number and - process ID of last process in pipeline
  • 5. Create, monitor and kill processes command jobs displays current list of jobs either running or stopped. jobs 5 foo:~ $ dd if=/dev/zero of=/dev/null bs=1 & [1] 1181 foo:~ $ cat /dev/urandom | grep hello & [2] 1183 foo:~ $ jobs [1]- Running dd if=/dev/zero of=/dev/null bs=1 & [2]+ Running cat /dev/urandom | grep hello & Ex:
  • 6. Create, monitor and kill processes Control jobs 6 key sequences entered to foreground processes: Key Signal Meaning Usage Ctrl+C SIGINT Interrupt Interrupt the program running in the foreground Ctrl+Z SIGSTOP Suspend Suspend the program running in the foreground cmds entered to control background processes. Command Meaning Usage fg foreground Run the background job in the foreground. If it has suspended, restart it. bg background Restart a suspended job. fg makes most recently executed job a foreground job. You can specify a specific job number. (Ex. fg 2 will make job 2 run in the foreground) bg makes most recently executed job continue to run in background. You can make a specific job run in the background by specifying a job number (Ex. bg 2)
  • 7. Create, monitor and kill processes Control jobs 7 kill command kill job based on job number (instead of PID) using percentage sign to specify the job number foo:~ $ jobs [1]- Running dd if=/dev/zero of=/dev/null bs=1 & [2]+ Running cat /dev/urandom | grep hello & foo:~ $ kill %1 foo:~ $ [1]- Terminated dd if=/dev/zero of=/dev/null bs=1 foo:~ $ jobs [2]+ Running cat /dev/urandom | grep hello & foo:~ $ kill %2 foo:~ $ [2]+ Terminated cat /dev/urandom | grep hello Ex:
  • 8. Create, monitor and kill processes Disconnected processes 8 commands nohup and setsid - used to run processes disconnected from terminal that started them. nohup sets the signal mask for the process it starts to ignore the SIGHUP signal. SIGHUP signal is sent to each process when the shell exits. - happens when you exit a session on console, or via network connection. •nohup writes the output to a file - nohup.out •nohup is generally used - When you know that the process you are going to run should continue to run after your session ends.
  • 9. Create, monitor and kill processes Monitoring processes 9 ps – process status options supported by ps are somewhat complex. GNU version supports: Unix98 options (letters); BSD options (dash); GNU options (two dashes). To ... Unix98 BSD - Show all processes ps -ax ps -A ps -e - Show full info ps -u (user format) ps -f (full listing) - Show full info for all processes ps -uax ps -ef ps -Af foo:~ $ ps -f UID PID PPID C STIME TTY TIME CMD georgem 987 612 0 20:32 pts/2 00:00:00 /bin/bash georgem 3398 987 0 21:11 pts/2 00:00:00 ps -f foo:~ $ ps u USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND georgem 987 0.0 1.7 4676 2040 pts/2 S 20:32 0:00 /bin/bash georgem 3399 0.0 0.5 2524 696 pts/2 R 21:11 0:00 ps u Ex: ps -w – display in wide format ps -f – display in forest of processes, similar to output of pstree.
  • 10. Create, monitor and kill processes Monitoring processes 10 top – displays processes that use up the most CPU or memory. Ex:
  • 11. Create, monitor and kill processes Signals 11 Processes in Linux do not communicate with each other directly, but send each other signals via kernel. most common signal sent is SIGTERM, means Terminate, unless you know what to do signal(7) man page. Ex: http://linux.about.com/od/commands/l/blcmdl7_signal.htm