Screen Commands

I have found myself using Byobu by default in Ubuntu machines in order to manage multiple "terminals" in a single session. Byobu has many other advantages, but this is what I primarily use it for. However, Byobu is not as easily installed on CentOS (still can be) and even when it is installed, it doesn't look nearly as good. Also, if there are other administrators that primarily use windows, they can have difficulties when attaching to a byobu session (which can be resolved with some extra steps). Thus, you may find it useful to just use the screen technology that works great in both Ubuntu and CentOS, and is easily installed on both systems. Here is a quick lookup list of commands to interface with the screen tool.

Create A Screen


Create A Screen With A Name

screen -S $NAME

Create A Screen Or Connect To It If Exists

This will connect to the screen, even if other people are currently using it which can be useful

List Running Screens

screen -list

This will output a list of all the screens running, which includes their ID and their name.

Two screens can exist with the same name, in which case you may need to make note of the ID instead. No two screens will have the same ID

Restore A Screen

Screen -r $SCREEN_NAME
screen -r $SCREEN_ID

This command will restore a screen by its name or by ID. If there are two screens with the same name, it will throw an error and ask you to resolve by ID

Exit Out of A Screen

Ctrl+a, d

The next couple of "commands" are actually key combos to be executed inside a screen session in order to create an effect similar to below

Create A Split Screen

Ctrl+a, S
Split screens do not appear in screen -list. You will also need to use the next two commands in order to make use of the split.
Make sure to use a capital 's'

Cycle Split Screens

Ctrl+a, tab

Create A Screen

Ctrl+a, c

Close A Split Screen

Ctrl+a, X
Make sure to use a capital 'x'


No comments:

Post a Comment