Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So here's the setup:

I have a remote computer running a program directly in CLI from user account NN. If I SSH into the same user account NN, is it possible to see the output of the program running in the first user account instance from the second instance?

share|improve this question
up vote 2 down vote accepted

Unless the program is logging its output into a file, I'd say "no, not directly".

However, there is a way of achieving what you want. Use screen, which is a virtual console multiplexer:

(You can also use tmux which is more modern, but I'm not familiar with that so my answer will talk about screen).

Once you get screen installed:

  • Log into the remote system.
  • Start screen (just type screen, then read the intro screen, press space).
  • You'll see what looks like a standard command prompt. It is, however it lives inside one of screen's virtual consoles.
  • Start your program here.
  • When you want to leave your program working and log out, first "detach" screen. This "detaches" it from your actual terminal but screen (and the program contained inside it) continue running. The program thinks it's connected to an actual terminal so it will see no difference. To do this, press ctrl-a, then d (ctrl-a is screen's control prefix). You'll go back to a command prompt.
  • To reconnect to a running screen instance, type screen -rd. This will bring back screen and your running program.

You can of course detach and then log out entirely. When you log back in, you just screen -rd to get your "session" back.

Screen can do a lot more than that, you can have multiple "consoles" open, switch between them, copy and paste data, and even use split views and fancy stuff like that.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.