Why and how to use the screen command

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey guys it's durian before I get on to what I'm gonna show you today I just want to remind everyone I just opened up my new Twitter account it's at durian dot slash just posting what I do random articles links to my videos and whatnot so if you spend more time on Twitter than YouTube go check it out anyways today I'm going to show you how do you scream and why you would want to use it it's really good for remote administration I'm gonna get to in a second and it's easy to install like anything else it's in the repos you have to do anything special just sudo I have to install screen boom it's done so now this is on my local machine here but I have another window open and this is SSH into my little server that I have downstairs you know there are some tasks that take quite a bit of time to do and if you're remoted into it well you might have to close your terminal that you're using and that basically closes everything you have running in that terminal what screen does is it basically opens a terminal within the terminal if you can wrap your head around that so I'm just going to start up screen now remember I'm remoted into my server right now and it's above blah this license is yadda yadda so now I'm in my server in screen so can I do all the commands of screen start with control a so if I do control a questionmark you get all your key bindings which is pretty awesome he had split kill info detach is when you're gonna use a lot when you see the up arrow that means control so everything is going to be control a and then one of these commands so control a control D will detach control a and s capital S we'll do a split and there's also another one it's using the pipe we'll do a horizontal split which I'll show you so let's say I have a few things that I want to monitor while I'm working here so let's say H top all right so I want to keep an eye on this stuff so I could make my terminal pretty big and granted your text isn't gonna be as big so you'll be able to see more but just for the purpose of the video I made it big and then you want to do there's something else you want to monitor so let's do control a control C which is create now this creates a new screen within the screen so now here I can say I want to watch disk space for some reason so now this is going to show me real-time disk space that gets updated every two seconds now if I do control a control n for next it goes back to what I was doing before control that control then back kind of like when you do all control f 1 F 2 F 3 now the cool thing is you could do control a pipe and split it horizontally so now I can and if you want to switch its control a tab if you could see the little cursor here flashing so control a tab and it's flashing in the bottom corner here so it's really tabs so I'm now in this window sorry this window on the right and now I can do control a control n to go next right because now I can scroll through in each window so now if I could do control a trollee next patrol the a tab alright now I'm back in this window here on the left and I'm going to do control a and capital S nope sometimes you lose track of what's going on where you are okay so now I've split this vertically or split it horizontally however you want to look at it and I can do control a tab and now I'm down here and I could do control a control C to create a third terminal within the screen so now I can go do other things down here it's kind of like how terminator which I'm using right now can split your window into multiple other little terminals all at once now the cool thing about this is I'm doing some super long command what can I actually do I'm not gonna do anything let's just say for for the sake of it I am updating my repository mirror it's gonna take a very long time and then I got to do something I gotta close my terminal I gotta do whatever now the detach command which is right here will let you detach from screen so screen will continue running on the server but it's gonna disconnect you so let's just do control a control D now I'm out right there are commands if you do screen LS it'll tell you there's a screen on here because you can have multiple screens you can share screens if you do screen - r is going to reattach you into what you were in before you lose your little your little setup that you did with your split screens but if I do control a and all those windows that I had open are still open so you know I have to Reese Plitt up my windows again but as you can see it's not really that hard to do tab into here and then here and tab into here and there we go back to where before and everything stayed running in fact I can even exit from the server because my server is still running closed my terminal shut off my computer because it's still running on my server it's not running on my machine here so if I do screen are again I'm back and I still have the windows open so if you're doing something really long you can do your screen commands and and then you're going to detach and leave everything running and now once you exit it's going to exit each screen that you have opened one at a time and now this is the last one right if I do control a control and there's no other window as it says in the bottom right corner there so I'm gonna stop this and once I exit this screen is terminating because I've exited all my screens and that's it that's all I really wanted to show you hope you find it handy if you do a lot of remote stuff even on your own PC can all know you can't really because you have to leave the terminal open that's running screen but you understand my point anyways hope you find it useful check out my new Twitter I only have 6 followers I need more I don't need more but you know it's it's cool to be followed now I guess and having a new Twitter account is hard I forgot how hard it was anyways that's about it so I'll see you next time
Info
Channel: DorianDotSlash
Views: 50,587
Rating: 4.909483 out of 5
Keywords: linux, remote, ssh, server, linux screen command, screen command, how to use sreen command, how to use the screen command, how to use screen in linux, screen terminal, use screen in terminal, linux terminal
Id: Mw6QvsChxo4
Channel Id: undefined
Length: 8min 30sec (510 seconds)
Published: Thu Oct 05 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.