9th May 2010 - 3 minutes read time
A useful technique to know about when using Linux is to run commands in the background. Sometimes certain commands can either take a while (like copying a large file) or will simply take over the terminal window when run. For example, lets say that you open a file in gedit, you might use the following command.
gedit file.txt
Doing this will open the file in gedit but will not allow you to do anything in the terminal window until you close gedit. To open the file but still keep the terminal window active use the & symbol at the end of the command. This will run the proceeding command in the background.
gedit file.txt&
To run a file copy in the background do the following.
cp file.txt file.txt.bak&
Note that this command shouldn't be used for all commands, especially those that produce some form of output. For example, running the following command