Tip Details Add a Related Tip

Rate as: Positive Negative

Changing an already running job to execute in the background

For any *nix system, including the Mac, if you are running a job and it is taking longer than you expected, you can give up and sit there, or you can get fancy and have the already running job convert to running in the background. Here's the trick on how to do this.

First, we start a long running job like so:

find / -name test -print

Once this is running type Ctrl + Z. This will stop your job, but it will not kill it. You can then type jobs on the command line. This will show all jobs on the system. Here's the sample put you would see:

[1]+  Stopped                 find / -name test -print

Now, to convert the job to running in the background, select the job number (there is only one in this case, and the job number is 1) and type the following on the command line:

bg %1

where in this case, 1 is the job number to be run in the background. If you have multiple jobs running, you will need to enter the number that corresponds to the job you want to run in the background. If you then type the jobs command you'll see this output:

[1]+  Running                 find / -name test -print &

which indicates that the job is now running in the background. If you want to bring the job back to the foreground, you can use the fg comand like so:

fg %1

where again the number 1 indicates the job to run in the foreground.

Using this command, you can save yourself from a long unexpected wait.
Rating: no ratings, 0 total Votes
Categories: linux UNIX Mac
Added: on Aug 06, 2007 at 11:57 am
Added By: an anonymous user

Comments on this Tip

Add a Comment
There are no comments for this tip
Your Comment:
(how to format)
Rate This Tip:

Verify Humanity:
Sorry, we know it's annoying, but please enter the characters shown in the image to the left so that we know you're an actual person and not an evil spammer. Thanks.
       

Related Tips

ssh and scp without passwords

Categories: shell Mac linux UNIX
100% positive, 1 comment - last added on Jun 20, 2008 at 9:19 am
– Tip added by an anonymous user on Dec 21, 2007 at 2:51 pm

Running X11 programs from the terminal

no ratings, 0 comments
– Tip added by an anonymous user on Jan 28, 2008 at 8:04 am

Update your shell prompt

Categories: UNIX Mac linux shell
no ratings, 0 comments
– Tip added by an anonymous user on Jun 04, 2007 at 9:15 pm

Color coding the ls command in Fedora

100% positive, 0 comments
– Tip added by an anonymous user on Apr 25, 2008 at 8:27 am

iTerm for the Mac

Categories: Computers Mac UNIX
66% positive, 1 comment - last added on Mar 06, 2007 at 4:29 pm
– Tip added by rlansky on Mar 03, 2007 at 7:02 am

Software Development Automation with Scripting Languages

Categories: linux unix scripting
no ratings, 0 comments
– Tip added by an anonymous user on Jun 05, 2008 at 2:40 pm

web clip widgets

100% positive, 0 comments
– Tip added by an anonymous user 5 days, 8 hours ago

Remove Spotlight icon from manu bar

100% positive, 0 comments
– Tip added by an anonymous user 6 days, 11 hours ago

Installing PHP GD on a Leopard Mac

100% positive, 0 comments
– Tip added by an anonymous user on Jun 27, 2008 at 1:39 pm

Adding searches to the Finder sidebar

100% positive, 0 comments
– Tip added by an anonymous user on Jun 27, 2008 at 9:07 am

Speeding Office 2008 on a Mac

100% positive, 1 comment - last added on Jun 26, 2008 at 3:20 pm
– Tip added by an anonymous user on Jun 26, 2008 at 11:26 am

Quick searches in Safari

Categories: Mac safari search shortcut
100% positive, 0 comments
– Tip added by an anonymous user on Jun 25, 2008 at 9:26 am

Quickly emailing links on a Mac

Categories: Mac email shortcut
100% positive, 0 comments
– Tip added by an anonymous user on Jun 20, 2008 at 6:31 am

Printing Keynote handouts

100% positive, 0 comments
– Tip added by an anonymous user on Jun 19, 2008 at 5:48 pm

running multiple firefox versions on a Mac

Categories: browsers firefox Mac
100% positive, 1 comment - last added on Jun 18, 2008 at 7:58 am
– Tip added by an anonymous user on Jun 18, 2008 at 7:53 am

Aperture loupe style

no ratings, 0 comments
– Tip added by an anonymous user 5 days, 10 hours ago

Avoid messaging when apps hang on a Mac

Categories: Mac crash shortcut
no ratings, 0 comments
– Tip added by an anonymous user 6 days, 2 hours ago

Watch hi-def movie trailers in Front Row

Categories: Mac movies Front Row HDTV
no ratings, 0 comments
– Tip added by an anonymous user 6 days, 11 hours ago

keep track of the phase of the moon

Categories: Mac astronomy moon menu bar
no ratings, 0 comments
– Tip added by an anonymous user on Jun 23, 2008 at 4:53 pm

iPod Nano on desktop but not in iTunes

Categories: Mac iPod repair
no ratings, 0 comments
– Tip added by an anonymous user on Jun 19, 2008 at 8:47 am