A nice trick to run multiple jobs.

DON'T post new tutorials here! Please use the "Pending Submissions" board so the staff can review them first.
Post Reply
User avatar
Big-E
Administrator
Administrator
Posts: 1332
Joined: 16 May 2007, 16:00
16
Location: IN UR ____ , ____ING UR _____ .
Contact:

A nice trick to run multiple jobs.

Post by Big-E »

So, Linux never ceases to amaze me as there are new things I learn every day. You may have already known about the following, but its something new I just discovered (previous I would have used the screen utility). But now, I know how I can run multiple jobs in a single terminal window.

Say you have a long job you need to run, maybe you are compiling some source code and to do so, you run:

Code: Select all

make install 
instead you can run:

Code: Select all

make install &
Now, when you run the command with the ampersand it will set the process as a background [bg] process which you can then bring back at a later point to the foreground using the foreground [fg] command. If you have multiple jobs running as background processes you can run jobs -l to see what number is assigned to what process and then run fg # to bring up that specific process.

The simplicity is so useful.

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

btw, you can bring a background process back into foreground again with:

Code: Select all

fg
if you have more than one background process you can bring the 2nd one into the foreground by:

Code: Select all

%2
to check what background processes are running you can use the jobs command... :wink:
Image

User avatar
lilrofl
Siliconoclast
Siliconoclast
Posts: 1363
Joined: 28 Jan 2009, 17:00
15
Location: California, USA
Contact:

Post by lilrofl »

well that's down right helpful.

:D
knuffeltjes voor mijn knuffel
[img]http://i911.photobucket.com/albums/ac320/stuphsack/Sig.jpg[/img]

Post Reply