Monday, July 23, 2007

Job taking too long to complete? "bg" it.

If you execute a command but it's taking a very long time to complete you'll be stuck waiting at an unresponsive command prompt.

To wrest control back you can do the following:
Press CTRL+Z to stop the job and get your command prompt back, then
type "bg" then enter to run the job in the background
To see the list of jobs you've backgrounded type: "jobs" then hit enter
To bring one of the listed jobs back to the command prompt you can type "fg" then the number of the job you with to bringforward.
Summary:
CTRL+Z then "bg"
"jobs" to see the list of jobs in the background
"fg" then # to bring a job back front.

No comments: