Kobe Wang
Kobe Wang
Sep 3, 2018 · 2 min read

Linux Screen

Control Command

Command: “Ctrl-a”

Screen uses the command “Ctrl-a” that’s the control key and a lowercase “a” as a signal to send commands to screen instead of the shell.

For example, “Ctrl-a” then “?”. You should now have the screen help page.

Screen key bindings, page 1 of 4.

Command key: ^A Literal ^A: a

break ^B b only Q

clear C other ^A

colon : pow_break B

copy ^[ [ pow_detach D

detach ^D d prev ^P p ^?

digraph ^V readbuf <

displays * redisplay ^L l

fit F removebuf =

flow ^F f reset Z

focus ^I screen ^C c

hardcopy h select '

help ? silence _

Key bindings are the commands the screen accepts after you hit “Ctrl-a”. You can reconfigure these keys to your liking using a .screenrc file, but I just use the defaults.

Creating Windows

Command: “Ctrl-a” “c”.

To create a new window, you just use “Ctrl-a” “c”.

This will create a new window for you with your default prompt. Your old window is still active.

For example, I can be running top and then open a new window to do other things. Top stays running! It is still there. To try this for yourself, start up screen and then run top. (Note: I have truncated some screens to save space.)

Start top

top - 09:10:33 up 35 days, 17:26, 1 user, load averag

Tasks: 131 total, 1 running, 130 sleeping, 0 stoppe

Cpu(s): 0.4%us, 0.2%sy, 0.0%ni, 99.4%id, 0.0%wa, 0

Mem: 12302040k total, 6363652k used, 5938388k free,

Swap: 1052248k total, 12k used, 1052236k free,

Now open a new window with: “Ctrl-a” “c”

Your top window is still running you just have to switch back to it.

Switching Between Windows

Command: “Ctrl-a” “n”

Screen allows you to move forward and back. In the example above, you could use “Ctrl-a “n” to get back to top. This command switches you to the next window.

The windows work like a carousel and will loop back around to your first window.

You can create several windows and toggle through them with “Ctrl-a” “n” for the next window or “Ctrl-a” “p” for the previous window.

Each process will keep running until you kill that window.

https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/

Kobe Wang

Written by

Kobe Wang

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade