Saturday, January 9, 2010

Running processes in background

While normal usage on linux, you may come across situations where you wish, what if we could run the process in background.

Like I use a script to login to use the internet. That script runs in the terminal, so what a normal user would do is open the terminal until he wants the script to keep running, which sometimes bugs a lot.

The better way is running s script in backgroud..
For ex, if the script name is

$./ &
This will run the script in background. To see all programs running in background, type

To bring it to the foreground, type

So, problem solved...

But what if you forgot to append '&' and script has already started running. Now, if you wish to send the script to background, you will have to do two things. First, suspend the script to background and then make it run..
Below is the example for a script '' with all the commands..

shadyabhi@shadyabhi-desktop:~$ ./
Enter your ID: 200801076
Login ATTEMPT at: 09-01-2010 -> 14:14:17
Next attempt after: 3500seconds
Message from CYBEROAM: You have successfully logged in
[1]+  Stopped                 ./
shadyabhi@shadyabhi-desktop:~$ bg
[1]+ ./ &
shadyabhi@shadyabhi-desktop:~$ fg


  1. Amiable fill someone in on and this post helped me alot in my college assignement. Gratefulness you as your information.

  2. Sorry for my bad english. Thank you so much for your good post. Your post helped me in my college assignment, If you can provide me more details please email me.