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.

nice tip
Hi Dirk,
replace ‘$1′ (first parameter) with ‘$*’ (all parameters) and you can forget about the quoting ;)
Cheers,
Patrick.
Thanks for the detail, I added it to the post.
> Keep in mind any command that has a space will need put in parenthesis.
You can get around this. Change your script to this:
nohup $@ &> /dev/null &
This will capture all the arguments given to backprocess ($@), not just the first one ($1). :)
Guess I’m too late…
:)
Thanks!
Can you use bg to “sleep” processes, like if I have a lot of PDF’s open that I want to read “later” can I bg them to save memory?