I don't think what you want is possible. See this superuser thread titled: How do I detach a process from Terminal, entirely?.
I think you have essentially 3 options.
Option #1
Run the scripts that are polluting you terminal such that they're run like so:
nohup somescript &> /dev/null &
Which should run their STDOUT & STDIN to /dev/null, background them, and disconnect them from your terminal's signals if you should close it.
Option #2
Use something like screen
. Thanks to @StephaneChazelas in the comments it does appear that there are screen
packages available for Debian on your architecture.
Option #3
If you don't care if you temporarily pause the processes that are polluting your terminal's STDOUT you can use this setting: stty tostop
. This has the effect of stopping these processes from sending their STDOUT to your terminal. When you're done you can re-enable it with the command stty -nostop
. I found this in the Unix Power Tools 3rd edition book.
example
Here's my example app that is polluting my terminal's STDOUT:
$ while [ 1 ];do echo hi 2>&1;sleep 5;done &
This echoes out "hi" every 5 seconds like so:
[1] 30913
hi
$ hi
hi
hi
hi
Now when I run stty tostop
:
$ stty tostop
$ date
Thu May 9 14:22:44 EDT 2013
$ date
Thu May 9 14:23:52 EDT 2013
The trouble with this approach is that the other process is stopped:
$ jobs
[1]+ Stopped while [ 1 ]; do
echo hi 2>&1; sleep 5;
done
The trouble with this approach is that stty -tostop
didn't resume the process, just the setting of my stty
stating that STDOUT is allowed again. So I had to resume my process manually:
$ stty -tostop
$ jobs
[1]+ Stopped while [ 1 ]; do
echo hi 2>&1; sleep 5;
done
$ fg
while [ 1 ]; do
echo hi 2>&1; sleep 5;
done
hi
^Z
[1]+ Stopped while [ 1 ]; do
echo hi 2>&1; sleep 5;
done
$ bg
[1]+ while [ 1 ]; do
echo hi 2>&1; sleep 5;
done &
$ hi
hi
hi
hi
hi
The above shows my running stty -tostop
, then running the command fg
to foreground the while ...
process that was polluting my STDOUT, then Ctrl+Z, to stop the while ...
process, then use the background command, bg
.
Additional Ideas
Check out the suggestions tools on these U&L Q&As
There are extensive lists of tools and possible paths for you to try out as alternatives to screen
. Perhaps use tmux
or reconnect the processes that are polluting your STDOUT to another terminal using reptyr
.