How to use “screen” utility ?

Screen is a terminal multiplexer used to create multiple pseudoterminals. Here are some frequently used commands,

Session basics

Create a session

 screen -S <session name>
 screen -S newSession

List Sessions

 screen -ls

Detach from session[executed inside a session] “ctrl+a” then “d”

Reattach to session[executed outside a session]

 screen -r <session name>
 screen -r newSession

Commands inside a session

Screen Commands

Sl Description Command
1 Open a new window ctrl+a then c
2 List all windows opened ctrl+a then “ ctrl+a then w
3 Close a window ctrl+a then k
4 Navigate between windows in session ctrl+a then n (next window) ctrl+a then p (previous window)
5 Kill all window and current session ctrl+a
6 Switch between windows ctrl+a then 1 (switches to first window) ctrl+a then 2 (switches to second window)
7 Vertical splitting ctrl+a then “|”(pipe symbol)
8 Horizontal splitting ctrl+a then S
9 Close window pane ctrl+a then “X”
10 List all key bindings ctrl+a then ? (the “?” symbol)
11 Kill a window pane ctrl+a:remove

Reference to these notes

Youtube Video


— By Fabian Darius