DOC PREVIEW
FSU COP 3353 - Lecture 9 Unix Process

This preview shows page 1-2 out of 6 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Copyright August 2006, Daniel Chang COP 3344 Introduction to UNIX COP 3344 Introduction to UNIX Lecture Session: File System and Commands Topic: Process Control Daniel ChangCopyright August 2006, Daniel Chang COP 3344 Introduction to UNIX Process Commands UNIX is a multi-tasking operating system • Multiple "processes" can be run at once • Shell normally does not accept another command until current one completes Background execution • Place ampersand (&) at end of command dchang@quake:~>sleep 2 & [2] 8403 dchang@quake:~> [2] Done sleep 2 dchang@quake:~> • Command is assigned a process ID and a job number • Once the process completes a "Done" message is sent • Commands or programs that generate output will have output suspended, but might conflictCopyright August 2006, Daniel Chang COP 3344 Introduction to UNIX ps [-a][-l][-u] Description: Displays information about current processes. • Each process has a "process ID" Options: • [-a] All processes for everyone. • [-l] Displays longer version • [-u] Displays user oriented report Examples: ps -al jobs Description: Displays information on current jobs • Each job has a "job number" • State of each job is displayed ("Running" or "Suspended") • "Active" job is identified with (+) Example: dchang@quake:~>jobs [1] + Suspended (tty output) emacs [2] - Running sleep 10000 <ctrl-z> Description: While running some programs, <ctrl-z> will cause the program to suspend and be placed into the background. The shell will then be available for more commands.Copyright August 2006, Daniel Chang COP 3344 Introduction to UNIX bg [[jobnumber]] Description: Continues a suspended job in the background • You must use square brackets around "jobnumber" • If "jobnumber" is not specified the active job will be used • If the process referenced outputs to screen it may not be able to run in the background Options: • [[jobnumber]] The job number you want to run in the background. You must include square brackets around the actual number. fg [jobnumber|commandname] Description: Brings a suspended job back into the foreground • Do not include square brackets around "jobnumber" • If "jobnumber" is not specified the active job will be used Options: • [jobnumber] The job number you want to run in the background. Do not include square brackets around the actual number. • [commandname] Instead of the job number, the command itself may be used. This will fail if more than one job uses the same commandCopyright August 2006, Daniel Chang COP 3344 Introduction to UNIX kill pid Description: Stops a process running in the background Options: • [pid] The process ID of the process to kill. at [-f filename][-m] time [date] at -l at -r job Description: Schedules a command to be run at a particular time. Great for running CPU-intensive processes at a later date. Options: • [-f filename] Name of a file that contains the command. Otherwise you must enter commands manually, ended with <ctrl-d>. • [-m] Sends an electronic message when completed • [time] Indicates when you want to execute • [date] Indicates what day you want to execute on • [-l] List the names of commands that are already scheduled • [-r job] Cancels a job previously scheduled Example: at midnight <r> at> lpr Plov260 big.report <r> at> ^d <r>Copyright August 2006, Daniel Chang COP 3344 Introduction to UNIX script [-a][filename] Description: Starts a new instance of the shell, then stores the conversation you're having with UNIX in a file. To end recording, use the command "exit". Options: • [-a] Appends information to the file, preserving any existing contents • [filename] File in which to store output Examples: script -a


View Full Document

FSU COP 3353 - Lecture 9 Unix Process

Download Lecture 9 Unix Process
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 9 Unix Process and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 9 Unix Process 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?