The Blog

Screen command

In Linux, if you want to open multiple shell sessions on your local machine, you can do it by opening multiple terminal windows. But think of the scenario when you are logged into another server via SSH and want multiple shell sessions there. Here comes the importance of screen command.

Screen command will launch multiple shell sessions from one ssh session. Screen sessions can be detached and re attached later. While the session is detached, the process which was already started in that session will be running and managed by it.  If you re attach the screen session you can see that the terminals will be seen as the way it was before.

Syntax:

screen [-opts] [cmd [args]]

Installation command

sudo apt install screen

screen

screen -S new

-S : a new window will be started and we can give a name to that screen while creation itself so that it would be helpful to remember. This can be used to re attach the screen after some time.

screen –ls

-ls: It will show the list of screens created in this ssh session. Both Attached and Re Attached screens will be shown here

screen -d new

-d: It is used to detach a screen.

screen -r new

-r: It is used to re attach a screen. You have to give the screen name with the screen command

In DevOps Gurukul, we focus on giving hands-on experience while studying so that when you enter the industry, you won’t feel the pressure. DevOps Gurukul is one of the best training academies which provides the Best Linux Training Course Institute in Kerala and the Best DevOps Training Course in Kerala. We have experienced training professionals who are passionate about grooming the right candidates to start their successful careers. Come learn with us and have a bright future!

Leave a Comment

Your email address will not be published.

×

Powered by WhatsApp Chat

× How can I help you?