Write command in one terminal, see result on other one
Yes, it is. A picture worth a thousand words:
So, you have to redirect the output of your command using >
operator to /dev/pts/#
. You can find #
using who
or w
command. If tou want to redirect and the errors, use:
<command> >& /dev/pts/#
Something like this for your $HOME/.bashrc
:
ng() { gnome-terminal -x sh -c "$*; bash"; }
This will run a command and shows the result on a new terminal window.
Examples:
ng ls -l
ng echo foo
Edit: To consider aliases from the $HOME/.bashrc
use this instead:
ng() { gnome-terminal -x bash -ic "$*; bash"; }
then the output of ls
should be colored (thanks to Radu Rădeanu for this hint).