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

From vi, if you issue the command :sp, the screen splits into two "views", allowing you to edit more than one file from the same terminal.

Along those same lines, is there a way to have multiple shells open in the same terminal?

share|improve this question
I would like to add a note to the excellent recommendations below regarding tmux, When I first started using it, I would get frustrated by weird characters when I connected to an existing tmux session from a different computer. Since tmux allows you to have multiple sessions running from numerous places, it will stick to the geometry of the session that launched it. For example, if I launched the session as – Hopping Bunny Jan 6 at 2:38
up vote 149 down vote accepted

You can do it in screen the terminal multiplexer.

  • To split vertically: ctrla then |.
  • To split horizontally: ctrla then S (uppercase one).
  • To unsplit: ctrla then Q (uppercase one).
  • To switch from one to the other: ctrla then tab

Note: After splitting, you need to go into the new region and start a new session via ctrla then c before you can use that area.

EDIT, basic screen usage:

  • New terminal: ctrla then c.
  • Next terminal: ctrla then space.
  • Previous terminal: ctrla then backspace.
  • N'th terminal ctrla then [n]. (works for n∈{0,1…9})
  • Switch between terminals using list: ctrla then " (useful when more than 10 terminals)
  • Send ctrla to the underlying terminal ctrla then a.
share|improve this answer
Tmux also does this, and many terminal programs have split views and tabs. – Shawn J. Goff Feb 15 '11 at 16:51
Just what I was looking for, thanks! – Justin Ethier Feb 15 '11 at 16:58
One thing you might want to add - after splitting, you need to go into the new region and start a new session via ctrl-a c before you can use that area. – Justin Ethier Feb 15 '11 at 17:10
@AaronNewton ctrl+a then release everything then shift+s (don't know for caps lock, mine is disabled) – shellholic Dec 5 '11 at 12:43
Ctrl A Shift S splits the screen, then Ctrl A Tab switches to the other split, and Ctrl A c creates a bash prompt. Is there anyway to have these commands run automatically when starting screen so we don't have to run the commands all the time. – Michael Butler Sep 19 '12 at 14:22

Try tmux (Terminal MUltipleXer):

tmux screenshot

share|improve this answer
Screen vs tmux? tmux is probably better for advanced usage and is more modern, but screen is installed everywhere and works just fine. – user606723 Apr 11 '13 at 21:31
@Yonatan Maman, Please explain more in your answers. – PersianGulf Oct 31 '14 at 8:19
@Yonatan, I agree with Mohsen - you say it's better but don't provide any reason why it's better. – Adam Plocher Jan 8 '15 at 12:35
in my experience, screen is much more useful. – Farsheed Feb 7 at 2:55

As mentioned in the comments, besides screen, another good terminal multiplexer is tmux. You can refer to the manual for a complete description and command reference. Some basic operations to get started are:

  • Split screen vertically: Ctrlb and Shift5
  • Split screen horizontally: Ctrlb and Shift"
  • Toggle between panes: Ctrlb and o
  • Close current pane: Ctrlb and x

You can achieve more complex layouts by splitting panes. You can also have multiple windows with panes and switch between them.

  • Create windows: Ctrlb and c
  • Switch to next window: Ctrlb and n
  • Switch to previous window: Ctrlb and p
  • Destroy current window: Ctrlb and Shift5
share|improve this answer
Note that you can change tmux's prefix to something easier to reach than <C-b>. – Evan Teitelman Apr 7 '13 at 12:04
Destroy current window didn't work for me :( – Saul Ortega Jul 2 '15 at 18:07

If you want a program that just splits a terminal¹, there's splitvt. There are programs that split a terminal and do a lot of other stuff besides, such as Screen, Tmux, Emacs, …

¹ It's the terminal you're splitting, not the shell.

share|improve this answer
+1, good point about how the terminal is what is really being split. – Justin Ethier Feb 21 '11 at 14:37

Apart from the excellent suggestions on Screen and Tmux if you are using some sort of window manager you may be interested in Terminator you can split horizontally or vertically fashions, plus tabs and more... here's a list of features taken from the author's web site:

  • Arrange terminals in a grid
  • Tabs
  • Drag and drop re-ordering of terminals
  • Lots of keyboard shortcuts
  • Save multiple layouts and profiles via GUI preferences editor
  • Simultaneous typing to arbitrary groups of terminals

Have a look to the screenshots on the project site.

Most important you can combine Terminator with Screen/Tmux.

share|improve this answer
Note that using Terminator splits will be less convenient when copypasting between two windows of your editor. – gb. Aug 7 '12 at 2:00

Try Vertical Split for GNU Screen

This patch provides a vertical split feature for current releases of GNU Screen. The feature is designed to function in the same manner as screen's existing split command, but dividing the regions vertically instead of horizontally. Both forms of splits can be used together in any combination/quantity/order desired. Something similar is slated to appear in GNU Screen 4.1 soon, and is already available in CVS per this mailing list thread (and has been included in the Debian and Ubuntu screen packages starting with 4.0.3-10). Also, a recent project named ScreenWM is designed specifically to work with a vsplit-patched screen (check it out!).

share|improve this answer

Use terminator.

Should be available via your favourite package manager, if you use a mainstream distribution.

It is the only terminal multiplexer where copy-pasting works properly from within panes in your window.

share|improve this answer

Konsole for KDE has a built in function: Ctrl+(

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.