cs2044_Lecture8 - CS2044 - Advanced Unix Tools Spring 2009...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS2044 - Advanced Unix Tools Spring 2009 Lecture 8 David Slater dms236 at cornell.edu March 10, 2010 David Slater dms236 at cornell.edu CS2044 - Advanced Unix Tools Organization Homework 2 Due Monday March 15th Hopefully You Started Early! Turn In Code That Works! Follow Directions David Slater dms236 at cornell.edu CS2044 - Advanced Unix Tools Random Bash Query of the Day Running Jobs In the Background Nicely Suppose Im doing some science on a machine that others may also be using. How can I do my science without making their life hell. Mainly I would like to make sure the following are all true I want to run my job even if Im not logged on so others can check their email I want to run my job in a way that it doesnt take up all the system resources I want to run my job in a way that I can still use my shell while it is running This is easily accomplished and is very important David Slater dms236 at cornell.edu CS2044 - Advanced Unix Tools Background on the background The background... Move a job to the background: Ctrl-z to suspend, then bg to run it in the background Move a job to the foreground: fg Run a job automatically in the background: ./science.sh & See all running jobs: jobs -l David Slater dms236 at cornell.edu CS2044 - Advanced Unix Tools Being nice Run a job with the lowest priority: nice -19 ./science.sh & Nicest range from 19 to -20 (only root can do negative niceness) Make a job more nice: renice 19 pid This is important. If others are using the machine, your job will get less system resources and they can still get to facebook for all that important stuff... We can also start a job that will run even if we logoff by doing nohup nice -19 ./science.sh But I like... David Slater dms236 at cornell.edu CS2044 - Advanced Unix Tools Intro To Screen The screen command screen- a screen manager with terminal emulation Lets you logoff, then resume exactly where you were. Generally screen can be used just as you would normally use a terminal window. however, special commands can be used to allow you to save your session, create extra shells, or split the window into multiple independent panes. Passing Commands to screen Each screen commands consists of a CTRL-a (hereafter referred to as C-a) followed by another character. David Slater dms236 at cornell.edu CS2044 - Advanced Unix Tools Using Screen Attach a screen screen [options] Opens a new screen for use-a : include all capabilities Resume a screen screen -r [pid.tty.host] Resumes a detached screen session screen -x [pid.tty.host] Attach to a non-detached screen session If you only have one screen, the [pid.tty.host] string is unnecessary. There is alot more, but that is enough to be able to use it!...
View Full Document

This document was uploaded on 03/15/2010.

Page1 / 38

cs2044_Lecture8 - CS2044 - Advanced Unix Tools Spring 2009...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online