1 Day 10 Process Control. 2 Running a program in the background Here’s a trick: You can actually log onto a UNIX server as many times as you want Try.

Slides:



Advertisements
Similar presentations
June 1, 1999Foreground/Background Processing1 Introduction to UNIX H. Foreground/Background Processing.
Advertisements

Using tcpdump. tcpdump is a powerful tool that allows us to sniff network packets and make some statistical analysis out of those dumps. tcpdump operates.
CIS 118 – Intro to UNIX Shells 1. 2 What is a shell? Bourne shell – Developed by Steve Bourne at AT&T Korn shell – Developed by David Korn at AT&T C-shell.
Processes and Job Control. Foreground and Background (1)  Unix is a multi-tasking operating system –some of these tasks are being done by other users.
Process groups, sessions, controlling terminal, and job control Process relationship: –Parent/child –Same group –Same session.
Job Control Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
Introduction to Unix – CS 21 Lecture 10. Lecture Overview Midterm questions Jobs and processes description The foreground and background Controlling jobs.
Lesson 10-Controlling User Processes. Overview Managing and processing processes. Managing jobs. Exiting/quitting when jobs have been stopped.
LINUX System : Lecture 3 (English-Only Lecture) Bong-Soo Sohn Assistant Professor School of Computer Science and Engineering Chung-Ang University Acknowledgement.
A Practical Guide to Red Hat ® Linux ®, Third Edition. © 2007 Mark G. Sobell, Prentice Hall,
1 The Shell and some useful administrative Unix Commands How Unix works along with some additional, useful administrative Unix commands you might need.
CS 497C – Introduction to UNIX Lecture 26: - The Process Chin-Chih Chang
Linux+ Guide to Linux Certification, Second Edition
More Shell Basics CS465 - Unix. Unix shells User’s default shell - specified in /etc/passwd file To show which shell you are currently using: $ echo $SHELL.
Lecture 02CS311 – Operating Systems 1 1 CS311 – Lecture 02 Outline UNIX/Linux features – Redirection – pipes – Terminating a command – Running program.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 1Winter Quarter UNIX Process Management.
5 UNIX Processes. Introduction  Processes  How to list them  How to terminate them  Process priorities  Scheduling jobs  Signals.
1 The Shell and some useful administrative Unix Commands How Unix works along with some additional, useful administrative Unix commands you might need.
UNIX Processes. The UNIX Process A process is an instance of a program in execution. Created by another parent process as its child. One process can be.
Exam Revision. Exam Details Time 90 minutes (1hour 30 minutes). Six questions! How long per question? Five parts per question. How long for each part?
Linux in More Detail Shirley Moore CPS5401 August 29,
Operating Systems Yasir Kiani. 22-Sep Agenda for Today Review of previous lecture Process management commands: bg, fg, ^Z, jobs, ^C, kill Thread.
Command Line Variations Selected Readings in Chapters 3, 5, 6 u Project 1 kickoff u Streams & Redirection: Sections 5.2, 5.3 u Pipes and Tees: Sections.
The Shell Chapter 7. Overview The Command Line Standard IO Redirection Pipes Running a Program in the Background Killing (a process!)
Additional UNIX Commands. 222 Lecture Overview  Multiple commands and job control  More useful UNIX utilities.
Linux+ Guide to Linux Certification, Second Edition Chapter 10 Managing Linux Processes.
Adv. UNIX: Shell/21 Advanced UNIX v Objectives –to supplement the “Introduction to UNIX” slides with extra information about the Shell
Hands On UNIX II Dorcas Muthoni. Processes A running instance of a program is called a "process" Identified by a numeric process id (pid)‏  unique while.
1 CSE 303 Lecture 3 bash shell continued: processes; multi-user systems; combining commands read Linux Pocket Guide pp , , , 118, 122,
Agenda  Working with Processes: Purpose Running Programs within same process (execl, execlp, execle, execv, execvp, execve) “Spawning” other process (fork,
1 Advanced Unix Commands How Unix works along with some additional, useful Unix commands you might like to know.
Linux+ Guide to Linux Certification Chapter Eleven Managing Linux Processes.
1 Lecture 6 Introduction to Process Management COP 3353 Introduction to UNIX.
1 Day 18 Bash and the.files. 2 The.files ls shows you the files in your directory –Or at least most of them. –Some files are hidden. Try: ls –a –This.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
Chapter 5: The Shell The Man in the Middle. In this chapter … The command line Input, output, and redirection Process management Wildcards and expansion.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 Unit 9 Working.
1 Day 2 Logging in, Passwords, Man, talk, write. 2 Logging in Unix is a multi user system –Many people can be using it at the same time. –Connections.
– Introduction to the Shell 1/21/2016 Introduction to the Shell – Session Introduction to the Shell – Session 3 · Job control · Start,
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop VI Scheduling & Process Management Professional.
3.4 Notes: Factoring p. 74 in your book. FACTORING We’ll use the Sum and Product Technique We’ll use the Sum and Product Technique Our job is to find.
©Brooks/Cole, 2001 Figure 5-14 Job States fg. ©Brooks/Cole, 2001 백그라운드 / 포그라운드 (Background/Foreground Jobs) - 오랜 시간 작업을 요하며 터미널에서 입력을 받지 않는 작업인 경우 백그라운드.
Agenda Managing Processes (Jobs) Command Grouping Running jobs in background (bg) Bringing jobs to foreground (fg), Background job status (jobs) Suspending.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
An Introduction to processes R Bigelow. A Unix Process A process in Unix is simple a program The Unix system is made up of a group of processes all interacting.
Getting Started with Unix Naomi Altman. Connecting to a PSU Linux Cluster click on SSH click on "quick connect" Host Name: lxcluster.tlt.psu.edu User.
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
1 CSE 390a Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
Agenda Customizing a Unix/Linux account Environment Introduction to Start-up Files (.bash_profile,.bashrc,.profile,.kshrc) Safe Methods for Changing Start-up.
Process Relationships Chien-Chung Shen CIS/UD
ULI101 Week 05. Week Overview ● File system links ● Hard and symbolic links ● Process management ● Storage quota information (quota) ● Printing.
Foreground and background processes
slides created by Marty Stepp, modified by Josh Goodwin
...looking a bit closer under the hood
Rootly Powers and Controlling Processes
The UNIX Shell Learning Objectives:
Hands On UNIX AfNOG 2010 Kigali, Rwanda
CSE 374 Programming Concepts & Tools
Hands On UNIX AfNOG X Cairo, Egypt
The Linux Command Line Chapter 10
slides created by Marty Stepp, modified by Jessica Miller
Operating Systems Lecture 12.
CHAPTER 13 Processes.
Shell Programming.
CSE 390a Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
slides created by Marty Stepp, modified by Jessica Miller
CSE 390a Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
CSE 390a Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller.
Lab 6: Process Management
Lecture 6 Introduction to Process Management
Presentation transcript:

1 Day 10 Process Control

2 Running a program in the background Here’s a trick: You can actually log onto a UNIX server as many times as you want Try double-clicking on PuTTY a few times and log in every window You can run different things in different windows

3 Background For instance, you could run hangman in one window, elm in another, and have vi in another All appear to be running at the same time with no slowdown (usually)

4 More on Background Try running this command: primes It will print out all prime numbers between 0 and 100 Now keep running primes over and over and add zeros to the 100 each time primes

5 Running primes Eventually you will see that running primes takes longer and longer Try running this one: –primes > /dev/null This will take quite a while to finish You cannot type at the shell while this is running

6 Running primes in the background One solution: run primes in one window and do something else in another Or…. Run primes in the background of just one window!

7 Background processes You can start a command in the background (you maintain control of the shell and can run new commands) Special character: & Example: –primes > /dev/null &

8 Another way... You can also stop a process Command: CONTROL-Z You are given a job number: –[1]+ Stopped hangman The job number is in brackets

9 Stopped Jobs Jobs that are stopped can be brought back into the foreground Command: fg % Example: fg %1 Or they can begin running in the background Command: bg % Example: bg %1

10 You can also kill jobs CONTROL-C can only be used in the foreground Must kill background jobs Command: kill % Example: kill %1

11 Forget a job number? Command: jobs This will tell you job numbers for all running and paused jobs

12 Another Way You can also use a job’s pid (process ID) to kill it You can get the pid with: ps Then you can use kill: kill Example: kill 12994

13 Stubborn Processes You can force a process to die Command: kill -9 Example: kill