Introduction
Have you ever found yourself in a situation where you have to work off of one, just one terminal but felt that you are handicapped and you could be more productive with more than just one? Or have you found yourself kicked out of a terminal that you have some important command running but taking too much time which results to undesirable outcomes?
Well, let me introduce you to Screen, with the tools you can create multiple sessions in just one terminal.
I will share some basic commands that are commonly used to get you up to speed. A cheatsheet will be attached at the end at a later stage.
Installation
In order to start using you need to first install it.
Ubuntu/Debian
1
apt install -y screen
RHEL/CentOS
1
yum install -y screen
Starting Screen
Now you can start using more than 1 terminal in just one session.
Start a normal screen session
1
screen
To list screens
1
screen -ls
To start a screen session with a screen name ‘screen1’
1
screen -S screen1
To attach to a screen with a screen name ‘screen1’
1
screen -r screen1
Screen commands
Once inside a screen session, to activate the screen commands/shortcuts you need to enter Ctrl+a
along with the following for various features
Ctrl+a c
To create a new screenCtrl+a n
To move to the next screenCtrl+a p
To move to previous screenCtrl+a "
To see a list of all available screens (where"
is Shift+’)Ctrl+a Esc
To scroll up the terminal in copy mode. Once in copy mode use up and down arrows to navigate and pressenter
to select.