command run on another terminal

Ok, weird question, but I was just wondering if this is possible. Let's say I have two terminals open and I run a command on one, while it's running is it possible to check the last executed command on that other terminal? A random thought I had today and wouldn't mind knowing.
 
egelor said:
You can do it easy by checking the history file on your login shell.

That only shows which commands have been started. It doesn't show if they're still running and you also can't 'see' the output.

Simplest solution would be to use sysutils/tmux or sysutils/screen. I definitely recommend tmux(1).

On the second terminal you can tmux att and you'll see exactly the same tmux session as on the other terminal. You can even detach the session completely and everything running inside it will keep running. Easily picked up again from another terminal or even a remote SSH. Quite handy if you work on a remote machine that has a crappy connection.
 
Back
Top