8 July, 2009
Backgrounding tasks using the & symbol at the linux terminal
One of the primary features of a linux based operating system is the terminal. Although the use of the terminal is not needed it can make work faster and easier. However in order to do this an understanding of the features offered in the terminal needs to be gained.
One of the really useful features within the terminal is the ability to start up applications or processes in the "background" this is achieved by using the special symbol & within the terminal. Applying the symbol at the end of a line tells the terminal to start the command in the background, so for example if you wanted to edit a text document using gedit and wanted gedit to be started as a background task the command that you would enter is:
gedit FILE &
The advantage of running a command in the background is that the terminal is still useable while the application is running, normally when an application is run the terminal will not except commands until the first application has finished running. Running the application in the background also allows you to shut down the terminal without terminating the application that is running.
There are however problems with running a command in the background, the primary problem is that if the application that is run in the background is expecting a response on the command line you will not be able to provide it with one, as such the applications that you choose to run in the background should be chosen with care. It is possible after running a application to transfer it into the background, how this is done is covered in this tutorial.
------------------------------------------
NOTE: These articles are tutorials/general ramblings. I do not except responsibility for anything that goes wrong, be it a broken HDD, an entire computer or if you chop off your arms, follow anything I say on this site at your own risk.
------------------------------------------
Comments
Leave a comment