When working on the Linux command line, you can start a task, move it to the background, and, when you\u2019re ready to reverse the process, bring it back to the foreground. When you run a command or script in the foreground, it occupies your time on the command line \u2013 until it\u2019s finished. When you need to do something else while still allowing that first task to complete, you can move it to the background where it will continue processing and spend your time working on something else.\nThe easiest way to do this is by typing ^z (hold the Ctrl key and press \u201cz\u201d) after starting the process. This stops the process. Then type \u201cbg\u201d to move it to the background. The jobs command will show you that it is still running.\n$ mytask\n^Z\n+ Stopped mytask\n$ bg\n$ jobs\n+ Running mytask &\n\nNow let\u2019s look at an easy way to try this out.\nFirst, put a simple script like this together and make it ready to run.\n#!\/bin\/bash\n\nwhile true \ndo\n date > x\n sleep 120\ndone\n\nThat script will put the current date and time to a file called \u201cx\u201d every 2 minutes. Since it overwrites the file once it exists, it doesn\u2019t use up additional disk space.\nNext, start the script. If the script is called \u201cloop\u201d, you would use a command like this:\n$ loop\n\nNext, use the ^z trick to stop the process after starting it.\n$ loop\n^Z\n+ Stopped loop\n\nThen use the bg command to move it to the background where it will continue running.\n$ bg\n+ loop &\n\nThis particular script will run forever or until you kill it, log out or reboot the system. You can terminate it by using the kill command followed by the background process id.\n$ kill %1\n+ Terminated loop\n$ jobs\n\nThe jobs command with no output tells you that no more backgrounded processes are still running.\nStart a process in the background\nYou can also put a process in the background when you first start it by following the command or script name with an & character. In the example below, I\u2019m running a second looping script in the background and then using the jobs command to view all backgrounded processes.\n$ loop2 &\n 4651\n$ jobs\n- Running loop &\n+ Running loop2 &\n\nNotice the \u2013 and + signs in the output above output following the  and  process numbers. These will only appear for the two most recently backgounded tasks. These jobs can be referred to as %1, %2 or simply as \u2013 and + when you want to move them to the foreground with a command like fg +.\nBringing backgrounded tasks back to the foreground\nIf you have processes that are running in the background, you use the fg command to bring them back to the foreground. To move the loop task to the foreground, you could use either of the commands shown below.\n$ fg %1\n$ fg \u2013\n\nYou can use the jobs command to show the backgrounded tasks.\n$ jobs\n+ Running loop2 &\n\nNotice that only one of the two tasks remained in the background after the first was brought back to the foreground with the fg \u2013 command.\nWrap-up\nDepending on what you\u2019re working on, moving tasks to the background so that you can take control of the command line for more pressing tasks while allowing the backgrounded tasks to continue running can save time can be a smart move.