Study Guide Processes & Job Control

Similar documents
Lecture 5: Jobs and Processes

UNIX. The Very 10 Short Howto for beginners. Soon-Hyung Yook. March 27, Soon-Hyung Yook UNIX March 27, / 29

Processes. System tasks Campus-Booster ID : **XXXXX. Copyright SUPINFO. All rights reserved

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

CS Unix Tools. Fall 2010 Lecture 10. Hussam Abu-Libdeh based on slides by David Slater. September 29th, 2010

Linux Tutorial #6. -rw-r csce_user csce_user 20 Jan 4 09:15 list1.txt -rw-r csce_user csce_user 26 Jan 4 09:16 list2.

Linux Command Line Interface. December 27, 2017

Unix Processes. What is a Process?

CSCI2467: Systems Programming Concepts

UNIX Kernel. UNIX History

Bashed One Too Many Times. Features of the Bash Shell St. Louis Unix Users Group Jeff Muse, Jan 14, 2009

Operating Systems Lab 1 (Users, Groups, and Security)

Most of the work is done in the context of the process rather than handled separately by the kernel

An Introduction to Cluster Computing Using Newton

Part I Introduction General Information

IBM AIX Operating System Courses

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1

07 - Processes and Jobs

CSC209H Lecture 1. Dan Zingaro. January 7, 2015

CMSC 201 Spring 2018 Lab 01 Hello World

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1

1Z Oracle Linux Fundamentals (Oracle Partner Network) Exam Summary Syllabus Questions

The UNIX Shells. Computer Center, CS, NCTU. How shell works. Unix shells. Fetch command Analyze Execute

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)

Linux System Administration

Appendix A GLOSSARY. SYS-ED/ Computer Education Techniques, Inc.

Command-line interpreters

Systems Programming/ C and UNIX

What is the Shell. Whenever you login to a Unix system you are placed in a program called the shell. All of your work is done within the shell.

The Unix Shell & Shell Scripts

Introduction: What is Unix?

elinks, mail processes nice ps, pstree, top job control, jobs, fg, bg signals, kill, killall crontab, anacron, at

CptS 360 (System Programming) Unit 2: Introduction to UNIX and Linux

UNIX Quick Reference

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

CMSC 201 Spring 2017 Lab 01 Hello World

File system Security (Access Rights)

UNIX Tutorial Five

Unix Tutorial Haverford Astronomy 2014/2015

Introduction to the Linux Command Line January Presentation Topics

Introduction to UNIX Shell Exercises

Shells. A shell is a command line interpreter that is the interface between the user and the OS. The shell:

Linux shell scripting intro/review

OPERATING SYSTEMS LINUX

Shells and Processes. Bryce Boe 2012/08/08 CS32, Summer 2012 B

Unix/Linux: History and Philosophy

Lab 2: Linux/Unix shell

System Administration

Lecture 3. Unix. Question? b. The world s best restaurant. c. Being in the top three happiest countries in the world.

CSC209. Software Tools and Systems Programming.

CSE 391 Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

Lecture-4. Introduction to Unix: More Commands, Boot-up Actions and X Window

CSE 390a Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

A Guide to Condor. Joe Antognini. October 25, Condor is on Our Network What is an Our Network?

ACS Unix (Winter Term, ) Page 92

EECS2301. Lab 1 Winter 2016

Study Guide Linux Terminals

Simplest version of DayOfYear

Review of Fundamentals

Exploring UNIX: Session 5 (optional)

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

Operating Systems. Copyleft 2005, Binnur Kurt

CSC209. Software Tools and Systems Programming.

CS370 Operating Systems

Name Department/Research Area Have you used the Linux command line?

elinks, mail processes nice ps, pstree, top job control, jobs, fg, bg signals, kill, killall crontab, anacron, at

Chap2: Operating-System Structures

Getting Started With Linux and Fortran Part 2

UNIX Basics by Peter Collinson, Hillside Systems. The Korn Shell

Users and Groups. his chapter is devoted to the Users and Groups module, which allows you to create and manage UNIX user accounts and UNIX groups.

Sperimentazioni I LINUX commands tutorial - Part II

Practical Computing-II. Programming in the Linux Environment. 0. An Introduction. B.W.Gore. March 20, 2015

Bamuengine.com. Chapter 7. The Process

Appendix B WORKSHOP. SYS-ED/ Computer Education Techniques, Inc.

Getting started with Hugs on Linux

RH033 Red Hat Linux Essentials

5/8/2012. Controlling User Processes Chapter 10

HW 1: Shell. Contents CS 162. Due: September 18, Getting started 2. 2 Add support for cd and pwd 2. 3 Program execution 2. 4 Path resolution 3

Linux for Beginners. Windows users should download putty or bitvise:

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

CSCI 2132 Software Development. Lecture 3: Unix Shells and Other Basic Concepts

CISC 220 fall 2011, set 1: Linux basics

Network Administration/System Administration (NTU CSIE, Spring 2018) Homework #1. Homework #1

The Unix Shell. Job Control

Programs. Program: Set of commands stored in a file Stored on disk Starting a program creates a process static Process: Program loaded in RAM dynamic

CST Algonquin College 2

What is an operating system (OS or O/S)?

Getting started with Hugs on Linux

Introduc+on. General Information. General Information. General Information. General Information. General Information

Lecture 24: Multitasking and Signals

Community Enterprise Operating System (CentOS 7) Courses

Processes. Shell Commands. a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms:

Process Management forks, bombs, zombies, and daemons! Lecture 5, Hands-On Unix System Administration DeCal

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo

Performance Measurement

S E C T I O N O V E R V I E W

D. Delete the /var/lib/slocate/slocate.db file because it buffers all search results.

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description:

Q) Q) What is Linux and why is it so popular? Answer - Linux is an operating system that uses UNIX like Operating system...

Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX

Transcription:

Study Guide Processes & Job Control Q1 - PID What does PID stand for? Q2 - Shell PID What shell command would I issue to display the PID of the shell I'm using? Q3 - Process vs. executable file Explain, in your own words, what is the difference between a process and an executable file Q4 - Definitions What does each of the following terms stand for? STDIN stands for [stdin] STDOUT stands for [stdout] STDERR stands for [stderr] Q5 - Background PID What shell command would you issue to display the PID of the last command you moved to the background?

Q6 - List of jobs What shell command would you issue to display the list of jobs in the background of your current shell session? Q7 - Processes list What shell command would you issue to display the list of processes on your machine? Q8 - Notify What shell command would you issue to configure a bash shell to notify immediately when background jobs finish? Q9 - Stop notify What shell command would you issue to configure a bash shell to stop notifying immediately when background jobs finish? Q10 - Pausing What shell commands would you issue to display the message wake up! after a pause of 21 seconds? Do not run your solution in the background, type it on a single line. Q11 - Background STDIN redirects What is the STDIN of a background process redirected to? Q12 - Definition foreground process Explain, in your own words, what a foreground process is. Q13 - Definition background process Explain, in your own words, what a background process is.

Q14 - Background processes Describe, in your own words, how a process might end up in the background? Q15 - Bg Describe, in your own words, what the bg shell command does and give an example of when it would be used. Q16 - Bg examples Describe, in your own words, an example of when the bg shell command would be used. Q17 - Fg Describe, in your own words, what the fg shell command does and give an example of when it would be used. Q18 - Fg examples Describe, in your own words, what the fg shell command does and give an example of when it would be used. Q19 - Job vs. Process Explain, in your own words, the difference between a job and a process. Q20 - Background files redirects Why is it recommended to redirect the STDOUT and STDERR of a background process to a file? Q21 - Process vs. Job IDs Explain, in your own words, why when starting a program such as a text editor, its process ID is different than its job ID.

Q22 - Job states What are the three states any job might be in at any given time? Q23 - Foreground to background Describe, in your own words, how you would make a job running in the foreground transition to the state running in the background. Q24 - Background to foreground Describe, in your own words, how you would make a job running in the background transition to the state running in the foreground. Q25 - Notify options Explain, in your own words, what is the difference in the behavior of the Bash shell when we have the notify option turned on vs. turned off. Q26 - Korn shell We are working in a Bash shell session right now. I need to try something out in a Korn shell. I therefore issue the ksh command. The process running in the foreground of my Bash shell is now a Korn shell! Which of the shell will be suspended if I issue the suspend shell command. Q27 - Ksh to bash I ve been introducing a friend of mine to Bash. He was used to ksh so we started a bash shell from within his ksh and kept suspending it when we needed to go back to ksh for a minute for him to show me how he would tackle a given task with his old shell. I noticed that every time we suspend the bash shell, he entered suspend f. I told him this wasn t necessary. Explain why. Q28 - Shell vs. login shell Explain, in your own words, the difference between a shell and a login shell. Provide an example of when we would be working on a shell which is not a login shell.

Q29 - Empty data files It is late and I finally got my revolutionary program to compile and pass its tests. It s time for me to let it run for 20 hours straight while I take off to enjoy my weekend. I therefore issue the following command to have it execute in the background and dump its results in a file I ll look at later; greatprogram > gathered.data & In a hurry I hit ^D several time to log out from my Shell window and come back the following Monday only to find an empty gathered.data file! What did I do wrong? Q30 - Background running jobs What shell command would you issue to display the list of all jobs in that shell and their Job ID? Q31 - Listings What shell command would you issue to display the list of all jobs in that shell and their PID? Q32 - Back and forth What shell command would you issue to bring the job with job ID 5 to the background? Job #5 is not the current or previous job. Job #5 is the one executing the following command vi readme. Q33 - Definitions Describe, in your own words, what a current job Q34 - Spotting the right Describe, in your own words how you would find out which one of your job is the current job.

Q35 - To the foreground! Describe all the possible shell command syntaxes you might use to bring the job with job ID 5 to the foreground? Job #5 is not the current or previous job. Job #5 is the one executing the following command vi readme. Q36 - Bring it back! Explain, in your own words, why it might be useful to bring back to the foreground a job that has been put into the background at some point. Q37 - Ps What does ps stands for? Q38 - BSD Select all, if any, of the following branch of Unix systems is referred to as BSD? AT&T versions U.C. Berkeley versions SUN Microsystems versions Microsoft versions Q39 - Unix Select all, if any, of the following branch of Unix systems is referred to as UNIX? AT&T versions U.C. Berkeley versions SUN Microsystems versions Microsoft versions Q40 - Linux Select all of the following branch of Unix systems, if any, which Linux belongs to? You might have to research this on your own. BSD UNIX

Q41 - Ps Which set of options does the ps shell command support on Linux systems? You may select all, some or none. GNU UNIX BSD Q42 - ps times I started a program 5 hours ago which processed some data and stores it in a file. Intrigued as to why it is not yet completed, I issue a ps -f -p 12345 shell command, with 12345 being the PID of that process. The resulting display indicates in the TIME column a value of 00:53:27. Where are the rest of the 5 hours??? Q43 - Definitions What does the following terms stand for? * CUPS stands for [cups] * FTP stands for [ftp] * DNS stands for [dns] * NFS stands for [nfs] * NTP stands for [ntp] * RPC stands for [rpc] * SSH stands for [ssh] Q44 - Refreshing top What shell command would you issue to have the top utility refresh its output every 60 seconds for 5 minutes? Q45 - Refreshing top What shell command would you issue to have the top utility refresh its output every 60 seconds for 5 minutes and display only information for processes 12345, 54321 and 35142? Q46 - Processes using readme What shell command would you issue to display a list of all processes using a file named readme?

Q47 - Signals What shell command would you issue to display a list of all the signals on your Linux system? Q48 - Sending signals What shell command would you issue to send to process PID 12345 the signal to suspend it? Q49 - Priorities I started 2 hours ago a computation-intensive process in the background and realized that, since it will take many more hours to finish the job, I ought to reduce its priority as much as I am able to. The PID of that process is 12345, what shell command would I issue to set its nice value to 19? Q50 - Daemons vs. demons After watching the exorcist I felt like applying what I ve learned to system administration and decided to display the names of all the daemons running on my Linux system. What shell command would I issue to do so? Q51 - Processes tree display What shell command would I issue to display as a tree the hierarchy of processes which originated from my Bash shell of PID 12345? Q52 - Kill vs. kill -9 Explain, in your own words, the difference between issuing a kill or a kill -9 shell command on a given PID. Q53 - Nice boost I am remotely logged into one of our Linux server as a user and I have to run this computation intensive program. I am able to start it with the myprogram shell command. Since it is late and I am the only one logged on the server, I decide to use the nice command to boost as much as I can the priority of my process. Explain, in your own words, how I would do that.

Q54 - Nice background Let s say that I am logged onto my Linux desktop machine, working with the GUI and about to start a computation intensive program meant to run for 20 hours in one of my terminal windows. Should I use nice to reduce its priority while it runs in the background? Explain, in your own words, why or why not. Q55 - Anyone editing /etc/passwd I m remotely logged into a Linux server as a student and just heard someone in the lab mention that he was editing the /etc/passwd file on that same server! I am not the administrator of that machine and I am pretty sure they are not either. I d like to verify that no one is editing that file right now, how would I do that? Q56 - top I m remotely working as a user on one of our Linux server; the performance is really going down. After using the top utility, I see that one of the process that has been running for few minutes is monopolizing most of the CPU. I decided to get rid of it and issue the kill -9 12345 shell command, where 12345 is the PID of that process. The process is still running. Why?