LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   how to view a terminal from another terminal (https://www.linuxquestions.org/questions/linux-server-73/how-to-view-a-terminal-from-another-terminal-946026/)

kitek 05-20-2012 01:14 PM

how to view a terminal from another terminal
 
I have a box running centos 6. I have a console program that is running a server program that has to run in a working directory and in a console. I want to be able to run it on the box on a direct console. However, I want to be able to view that console from a ssh terminal from a remote location. Is there a way to SSH in and bring and view that terminal? I want to do this because this console program crashes from time to time and I want to be able to restart it and not have to have my say laptop opened and connected in that terminal to run it. What happens is when I close that remote terminal window of course that program gets killed. I know I could do this with vnc adn gnome but I just want to be able to do this through ssh.

Ser Olmy 05-20-2012 01:42 PM

Have you considered screen?

Edit: And then there's ttysnoop, of course.

kitek 05-20-2012 07:18 PM

Quote:

Originally Posted by Ser Olmy (Post 4683347)
Have you considered screen?

Edit: And then there's ttysnoop, of course.

If I understand this right, screen you would have to start out using screen in order to get it back? Cant just grab a local shell that is already running right?

Ser Olmy 05-20-2012 07:39 PM

Quote:

Originally Posted by kitek (Post 4683535)
If I understand this right, screen you would have to start out using screen in order to get it back? Cant just grab a local shell that is already running right?

Yes, that's correct.

kitek 05-20-2012 07:41 PM

Quote:

Originally Posted by Ser Olmy (Post 4683540)
Yes, that's correct.

What happens if you are in a screen and you suddenly get disconnected? The screen stays live since it is started until you Ctr-l k right?

Ser Olmy 05-20-2012 07:44 PM

Quote:

Originally Posted by kitek (Post 4683542)
What happens if you are in a screen and you suddenly get disconnected? The screen stays live since it is started until you Ctr-l k right?

That's the whole idea. You can reconnect to a detached screen session with screen -r.

kitek 05-20-2012 07:45 PM

Quote:

Originally Posted by Ser Olmy (Post 4683543)
That's the whole idea. You can reconnect to a detached screen session with screen -r.

Okay I think this will work fine. Just a lot of commands makes it seem more complicated than it really is. But thank you for telling me about screen. I had never heard of it before.


All times are GMT -5. The time now is 02:45 AM.