top of page
Writer's pictureJatin Madaan

Screen Command


There is a very useful command called screen , which comes in handy when we are working on EMR machines on aws or on servers where without disconnecting and without using help of mouse we have to switch screen and create different terminal sessions .


Moreover this command is also useful if you have to run some program on terminal and doubt that network issue may stop that program , so in this case create a new terminal with screen command and then detach it so that it runs in background and never gets timed out .


Basic Screen Commands :


1 : Screen command to check active screens :

There are 2 commands for same ie $ screen -ls and $ screen -list


2 : Screen command to create a new session :


$ screen -S [screen_name]



as soon as above command is triggered we get another screen like this :



and again you can check screens which are displayed by using command screen -ls



To go out of screen or what we call it here is detach , so to detach screen use command :


Control + A +D -- all 3 commands should be pressed at same time it will detach screen as below and return you back to old session which was running:



3 : Resume a screen


Now to again go back to same screen in case it was detached and not terminated .


$ screen -r [screen_name]




4 : Kill a screen


In case you need to kill only screen session forever use below command :


$ Screen -X -S [screen_name] kill



These commands require some practise but once learnt would be very useful .




25 views0 comments

Comentarios


bottom of page