Background a Process/Program
At times it is useful to see the output of what a program produces by typing its command line name in the terminal (for instance for debugging), at other times typing a program in the terminal just takes up space that could ordinarily be utilized for something else. Launching programs from the terminal can be put in the background easily with a bash script.
nohup is used to prevent hangups and then you redirect the output of the command to /dev/null (the great Linux blackhole). Here’s the script:
Then in the terminal use the bgcmd command with whatever program needed to be put in the background:
Backgrounding Already Running Processes
Already running applications can be backgrounded as well. First type Ctrl + Z to release the application, then use
bg to background it’s output.
Keep in mind though that if the terminal or tab is closed the program will close with it. Also too the
bg command doesn’t suppress all output.