• 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?

  • You can do it in screen the terminal multiplexer.
bash code
To split vertically: ctrl a then |.
To split horizontally: ctrl a then S (uppercase one).
To unsplit: ctrl a then Q (uppercase one).
To switch from one to the other: ctrl a then tab

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

EDIT, basic screen usage:

bash code
New terminal: ctrl a then c.
Next terminal: ctrl a then space.
Previous terminal: ctrl a then backspace.
N'th terminal ctrl a then [n]. (works for n∈{0,1…9})
Switch between terminals using list: ctrl a then " (useful when more than 10 terminals)
SendNew terminal: ctrl a then c.
Next terminal: ctrl a then space.
Previous terminal: ctrl a then backspace.
N'th terminal ctrl a then [n]. (works for n∈{0,1…9})
Switch between terminals using list: ctrl a then " (useful when more than 10 terminals)
Send ctrl a to the underlying terminal ctrl a then a.
ctrl a to the underlying terminal ctrl a then a.
[ad type=”banner”]

  • 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:
bash code
Split screen vertically: Ctrl b and Shift5
Split screen horizontally: Ctrl b and Shift"
Toggle between panes: Ctrl b and o
Close current pane: Ctrl b and x
  • You can achieve more complex layouts by splitting panes. You can also have multiple windows with panes and switch between them.
bash code
Create windows: Ctrl b and c
Switch to next window: Ctrl b and n
Switch to previous window: Ctrl b and p
Destroy current window: Ctrl b and Shift7

Below, show you only how to open 4 bash shells in one terminal you can increase it but 4 are enough according to you

  1. First of all open the terminal and run the command screen and then press. (now you invoked the screen and you are in)
  2.  Now press (control+a followed by shift+s) it will split the screen horizontally into two.
  3. So we created the two screens horizontally now its time to split the screen vertically as well so
  4.  Press (control+a followed by shift+| ( its a pipe sign) now it will split the screen vertically but in the top screen not at bottom to split the bottom screen vertically also we have to move to that screen so press (control+a followed by tab) two times then again press (control+a followed by shift+|) it will split the bottom screen vertically also.

Its time to run the shell in all remaining screens so to move from one screen to another press (control+a followed by tab) and then in that screen press (control+a followed by c) it will create the session there. So you will have 4 shells working in one single terminal .

[ad type=”banner”]

Categorized in: