Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

In ubuntu, How to dedirect stdout and stderr to separate screens with dual monitors?

share|improve this question
Do you want to do this on a command-line-only system, redirecting to different text-based virtual consoles displayed on two different monitors? Or is it sufficient to have two Terminal windows, one on one monitor and one on the other, run the command in one of them, and redirect stderr (or stdout) so it appears on the other? – Eliah Kagan Jun 1 '12 at 4:10
command-line-only system, with 2 monitors – linquize Jun 1 '12 at 6:21
Have you resolved this issue? – pl1nk Jun 24 '12 at 13:45
up vote 4 down vote accepted

With terminals in desktop Ubuntu

  • Open a terminal and move it to the second monitor.
  • Type tty in that terminal, and you will get a response of the form /dev/pts/N, where N is a number (1, 2, ....)
  • Open another terminal on the first monitor. This is where you will run your commands
  • To redirect stderr to the other terminal:

    command 2>/dev/pts/N

  • e.g. try ls /askubuntu 2>dev/pts/N and you should see ls: cannot access /askubuntu: No such file or directory on the second terminal.

  • Replace 2 with 1 to redirect stdout instead.

This should work similarly for virtual consoles on a command-line system, with /dev/pts/N replaced by /dev/ttyNbut I haven't tested it. Pseudo-TTYs (e.g. ssh sessions) still use the /dev/pts/N syntax.

share|improve this answer
The answer for desktop is fine – linquize Jun 1 '12 at 6:21

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.