Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

I asked the question How to use cat or less depending on the line count? with the intention of browsing many files without having to scroll up too far to view my history after displaying a long file, while keeping short files' contents directly visible.

However, it would be even more convenient to simply use half the screen for "usual" bash output and the other half (right or top, probably a matter of taste) for cat output. Is there a nice way (maybe some screen-magic) to achieve this? I.e. have a splitscreen terminal, where a simple pipe relocates output to the other half, and maybe some second pair of hotkeys to separately scroll through that half's buffer?

My first impulse would be using mkfifo for the pipe, but maybe there's an easier way or someone actually already wrote a tool for this...

share|improve this question
I use tmux and if i do - :pipe-page -o "cat >> /tmp/foo" i can see all content of the "windows" in the file. So if i split tmux and i would to tail -f /tmp/foo i would see the output of a "window" redirected to pipe. – Jiri Xichtkniha Jun 22 '12 at 13:03
Not an exact duplicate, but probably does what you want: Linux - How to split the terminal into more than one "view"? – Gilles Jun 23 '12 at 0:46
@Gilles thanks, very helpful link indeed – Tobias Kienzler Jun 23 '12 at 11:12

You can redirect cat output without any fifo and pipes to:

  1. /dev/pts/NUM where NUM is number of your logged in pts. it may not be usefull in screen splitting)
  2. /proc/PID/fd/0 (where PID is PID of your shell process in terminal, where output should appear).
share|improve this answer
thanks, now I just have to figure out how to use screen (or other means) to split the screen... – Tobias Kienzler Jun 22 '12 at 12:53
Ctrl+a | for vertical split Ctrl+a S for horizontal split Ctrl+a <tab> to switch – Bananguin Jun 22 '12 at 13:36
@user1129682 hey great, thanks! – Tobias Kienzler Jun 22 '12 at 14:00

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.