Multitask in Linux Terminal using Screen Software Program

Category : Linux/ Unix

Looking on how to multitask in Linux terminal? Today we will show how you can use the Screen software program to multitask in Linux Terminal.

Screen is a full-screen software program that can be used to multiplexes a physical console between several processes. It offers a user to open several separate terminal instances inside a one single terminal window manager.

The screen application is very useful if you are dealing with multiple programs from a command line interface and for separating programs from the terminal shell. It also allows you to share your sessions with other users and detach/attach terminal sessions.

Install Screen

(On Debian based Systems)
sudo apt-get install screen

(On RedHat based Systems)
sudo yum install screen

Start Screen

Run screen command in terminal

screen

It will open a fresh screen instance.

Type “Ctrl-a” and “?” without quotes. Then you will see all commands or parameters on screen.

screen help menu

To get out of the help menu you can press Space or Return.

Note: all shortcuts which use “Ctrl-A” is done without quotes and space.

Start Screen with session name

screen -S sessionname

Detach from Screen Session

Press Ctrl+a d

List Current Screen Sessions

screen -ls

screen list

Note: Attached Sessions means that they are currently opened in any of the terminal session and detached sessions mean they aren’t open in any of the terminal session.

Attach existing Screen Session

screen -r sessionname

Attach any  already attached Screen Session

screen -x sessioname

Move to next Screen Session

Press Ctrl+a n

Move to the previous Screen Session

Press Ctrl+a p

Create a new Screen Session within any Screen Session

Press Ctrl+a c

Now you can start using the Screen utility and create multiple screen windows from a single session, navigate between windows, detach and resume screen sessions