How to use GNU SCREEN - the Terminal Multiplexer - linux

Поділитися
Вставка
  • Опубліковано 10 лис 2024

КОМЕНТАРІ • 113

  • @Putnik29
    @Putnik29 4 роки тому +32

    Screen commands:
    screen (starts a screen session)
    ctrl a + d (detaches screen session)
    screen -ls (shows all screen sessions)
    screen -S dudeman (creates screen session dudeman)
    screen -r (use pid or the title in order to reattach) (reattaches screen session)
    screen -X -S dudeman quit (deletes the dudeman screen session)
    within screen session:
    ctrl a+k (kills the screen session or window)(if multiple windows within session, deletes only that window)
    crtl a+c (new window within screen session)
    ctrl a+w (shows all windows within screen session)
    ctrl a+n (shows next window)
    ctrl a+p (shows previous window)
    ctrl a+\ (kills all windows in session and closes session)
    ctrl a+ (integer)( goes to that specific window)
    ctrl a+" (shows a gui to select a window)
    ctrl a+A(shift a) ( changes window name)
    ctrl a+| (splits windows vertically)
    ctrl a+tab (switches between panes)
    ctrl a+S(shift s) (splits windows horizontally)
    ctrl a+X(shift x) (deletes the pane)
    if you ctrl a+d and detach, and then reattach, the panes will be gone
    ctrl a+x (locks the session) (default password is your login password)
    ctrl a+t (load average and time pops up)
    outside of window:
    screen -d -m python counter.py (runs the python program (counter.py) in the screen window)
    The screen session terminates once program is done
    ctrl a+? (shows all the key bindings
    ctrl a+: (shows the command, type remove and it removes the window)

    • @narasimhasriharshakanduri3325
      @narasimhasriharshakanduri3325 4 роки тому

      saved my time

    • @kulajit
      @kulajit 3 роки тому

      ctrl a+| (splits windows vertically) - somewhat does not work for me. Any other option?

    • @patbl
      @patbl 2 місяці тому

      @@kulajit It doesn't work with the default version of Screen installed on macOS (which is from 2006-you can see this by running `screen -version`). If that's the problem, you'll need to install a newer version.

  • @ayvep
    @ayvep 2 роки тому +1

    My comment is still relevant, just like your content is, 6 years later!!!! Flames bro, learnt a lot in this short space amount of time. What a flow👏👏👏👏👏👏

  • @Esparzamx
    @Esparzamx 6 років тому +6

    Thank you very much, was struggling with the darn manual, you just demystyfied all, great tutorial!

  • @ViaConDias
    @ViaConDias 3 роки тому +1

    Everything I wanted to know and then some in just one video, and perfectly explained, this is how to do a tutorial. Thank you

  • @johnblaisdell2179
    @johnblaisdell2179 2 роки тому

    great that I could actually see your terminal. So many videos are almost impossible to see. Thanks for the video

  • @NinuRenee
    @NinuRenee Рік тому +1

    As a regular tmuxer i must admit screens default bindings are way more intuitive and easier to remember compared to tmux

  • @hamedsarb
    @hamedsarb 7 років тому +5

    Very informative. keep making such a high quality tutorials.

  • @NoEgg4u
    @NoEgg4u 5 років тому +5

    This was a really good tutorial on how to use "screen".
    I understood everything. So I know it was clearly explained.
    Video could have stood a few less commercial interruptions.
    Again, great job, and thank you.

  • @holalluis
    @holalluis 7 років тому +4

    very good! I'm learning to use screen and this is by far the best video I've seen about it

  • @Seofthwa
    @Seofthwa 2 роки тому

    Excellent tutorial, very well presented. Sometimes the documentation is very dry and terse or not easily followed. This helped me a lot. Thanks!

  • @webdeveloper7994
    @webdeveloper7994 5 років тому +1

    I was searching such command from long time, you did great job here ... Thank a lot mate.

  • @zihanchen4312
    @zihanchen4312 3 роки тому

    Very Clear and Detailed explaination. Thank you a lot!

  •  5 років тому +2

    Very much to the point and just what I was looking for thanks mate, good job!

  • @WistrelChianti
    @WistrelChianti 5 років тому +1

    Brilliant! Thanks. Superbly explained. I love the repetition and reinforcement i.e. always demonstrating the status of the sessions and windows and panes after completing an action. Add an academic sandwich and it would be perfect.

  • @arsenabrahamyan7734
    @arsenabrahamyan7734 5 років тому

    Hi Dear Linux Leech Tutor :-) Thank you very much indeed for this detailed presented tutorial :-) But steel I have some questions to ask!!
    5 month ago I started to study Linux Ubuntu Server 18.04.2 LTS (Bionic Beaver) and I have already learnt a lot of commands and I can really use and apply them correctly but I have got problems with some shortcut keys within SCREEN command usage, like:
    Control-a+? Display brief help
    Control-a+A Accept a title name for the current window.
    Control-a+b Send a break to window
    Control-a+F Resize the window to the current region size.
    Control-a+h Write a hardcopy of the current window to file "hardcopy.n"
    Control-a+H Begin/end logging of the current window to file "screenlog.n"
    Control-a+i Show info about this window.
    Control-a+k Kill (Destroy) the current window. - I can also kill window by using Ctrl+d in Ubuntu Server
    Control-a+l Fully refresh current window
    Control-a+M Monitor the current window for activity {toggle on/off}
    Control-a+N Show the Number and Title of window
    Control-a+q Send a control-q to the current window(xon)
    Control-a+Q Delete all regions but the current one.(only)
    Control-a+Control-\ Kill all windows and terminate screen(quit)
    Control-a+_ Monitor the current window for inactivity {toggle on/off}
    .
    The other shortcut keys seem to work correctly.
    I cannot also split my screen by using ctrl+a+| it doesn't work anyhow!
    Help me, please!!!
    I thank you for your consideration in advance, and I look forward to hearing from you. Dear Tutor tell me what do you suggest or propose on this matter?

    • @linuxleech
      @linuxleech  5 років тому

      If they don't work add them to you ~/.screenrc file. This should get you started.
      In ~/.screenrc
      bind | split -v
      You should now be able to ctrl+a | to split your screen. As for the others, same method.

    • @arsenabrahamyan7734
      @arsenabrahamyan7734 5 років тому

      @@linuxleech Thank you very much indeed !!! :-)

  • @Qeelin
    @Qeelin 4 роки тому +4

    Great tutorial, maybe reduce the number of ads by a factor of 100

  • @champnaman
    @champnaman 5 років тому

    Great tutorial. Thanks for helping me learn the basics of the Screen.

  • @YanYong
    @YanYong 5 років тому

    I finally learn how to use screen! Thank man, your tutorial is very helpful.

  • @damithdananjaya4617
    @damithdananjaya4617 3 роки тому

    Great Tutorial

  • @BurkeMcCabe
    @BurkeMcCabe 3 роки тому +1

    Thank you, this was a very good tutorial.

  • @mickeyp1291
    @mickeyp1291 6 років тому +1

    best screen tutorial. learnt a lot thanks

  • @1988mib
    @1988mib 5 років тому

    Subscribed for voice quality, content and peaceful tutorial. However I use Terminix and sometmes tmux.

  • @ElectricSlevin
    @ElectricSlevin 5 років тому

    thanks, that was really straight forward...you're a life saver!

  • @ashishkumarsingh4867
    @ashishkumarsingh4867 5 років тому +3

    Simply awesome ...
    Thank you so much.

  • @lennartmeurer
    @lennartmeurer 3 роки тому

    First of all the Tutorial ist really good but in what order do I have to press buttons on the keyboard to rename a window? I dont get how to do strg + a + A properly to get into the bar where I can set the window-name. Thx in advance

  • @ge0rgi5d
    @ge0rgi5d 7 років тому +1

    Best tutorial on this topic :) Thanks

  • @ruixue6955
    @ruixue6955 2 роки тому

    0:35 start a screen session
    0:59 detach from screen session - Ctrl + A then press D
    1:15 screen -ls
    1:46 create a new screen session - 1:50 screen -S newssesionname
    2:34 re-attach

  • @jdev789
    @jdev789 7 років тому +3

    Very interesting tool - never played with it. The instruction flow was very organized. Looking forward to testing it.

  • @sebastianmusat8857
    @sebastianmusat8857 9 місяців тому

    very good material! thank you so much!

  • @JaneSmine
    @JaneSmine 8 років тому

    I like that you can also copy/paste via keyboard in screen.

  • @KendallVance
    @KendallVance 6 років тому +2

    i finally really get screen! Thanks!

  • @frankl1
    @frankl1 6 років тому

    Very clear tutorial.

  • @vilijanac
    @vilijanac 8 років тому +1

    Best tutorial available of using screen.
    Thanks for making it.
    I always wondered , why wasn't it made part of the bash shell, in the first place?
    It is so common and dates way back.
    Very useful when attaching and detaching on remote servers.

    • @linuxleech
      @linuxleech  8 років тому +1

      I think it might be because it is not essential i.e you can do everything you need to do without a multiplexer.
      If something like screen does get included with the bash shell then it probably wouldn't be too long before other tools get added, and bash as a project would become unmanageable.

    • @vilijanac
      @vilijanac 8 років тому +1

      But separating it, all in bits and pieces, scattered around. Needs a master to assemble per need. For example, tmux, it is good. But I don't need it. If I know screen. Have VIM. And I access an array of small servers I build on PI devices. Sure on my powerful desktop. I can also have multiple desktops and terminals open. Don't need screen, or to detach. To wait for me. :)

    • @ianiss9165
      @ianiss9165 8 років тому

      Seems like a fun tool, but as leech mentioned, I don't really see a lot of point to it. Maybe on remote connections to servers.

  • @Aleks-x2i
    @Aleks-x2i Рік тому

    Great video. Thank you!

  • @benrowlinson
    @benrowlinson 2 роки тому

    Just about every Big Book of UNIX I've ever known introduces the screen utility in a couple of incomprehensible paragraphs on page 1500, having spent its first 600 pages on some meticulous analysis of how to customize your cursor. Clearly that should be the other way around, and the fact that it isn't has to qualify as one of the modern era's most blatant cases of epistemological bottlenecking. And that's some almighty competitive field.

  • @umedina98
    @umedina98 2 роки тому

    Very useful, thanks!

  • @ArnoudRoeland
    @ArnoudRoeland 4 роки тому

    Thank you very much, this helped a lot.

  • @arifdale
    @arifdale 5 років тому

    Thanks for making this video!

  • @dradilashraf
    @dradilashraf 7 років тому +1

    Very well done. Thanks

  • @dorotazelga
    @dorotazelga 6 років тому

    Really nice explanation, thank you!

    • @linuxleech
      @linuxleech  6 років тому

      Glad you found it useful. Thanks for commenting.

    • @itprosetal
      @itprosetal 4 роки тому

      @@linuxleech So you thought she was cute too eh? :)
      Now that I have your attention, please answer my question about the password problem. When I lock the screen using ctrl a x, it won't accept my login password. I'm using Sun OS. I'm thinking that the reason it won't even take my password may be because of the Duo Multifactor Authentication that is set up for our Unix systems. What can I do to make it work? Any ideas?

  • @Ace-hg3vx
    @Ace-hg3vx 4 роки тому

    Is there a way to use a terminal and have another window to visualize what you're doing at the same time?

  • @kumargagare6154
    @kumargagare6154 3 роки тому

    Great great tutorial 👍👍👍

  • @williambarela2791
    @williambarela2791 7 років тому +2

    Thank you sooooooooo much! This is awesome.

  • @mahri233
    @mahri233 2 роки тому

    Everything with me was great and thank you very much for the demo. I am using iMac M1 zsh terminal. When you reach in your demo to window splitting (using the command ctrl a | for vertical split) It didn't respond at all. The horizontal splitting (ctrl a tab) is ok and I didn't have a problem with it. Can you please or anyone here can help or suggest advice. Thank you all

    • @alanvazquez6988
      @alanvazquez6988 2 роки тому

      Hi, I was having the same problem, the solution was to update `screen` I did it using `brew install screen`

  • @kritikamalaviya6995
    @kritikamalaviya6995 Рік тому

    Hi
    Ctrl a + w does not work for me ,any solutions ?Also is there any way to display the windows bar permanently inside screen like it is theer for tmux multiplexer .....?

  • @benx05
    @benx05 5 років тому

    Perfect tutorial.. two thumbs up :D

  • @pythgoreansassistant2789
    @pythgoreansassistant2789 2 роки тому

    Is it possible to scroll in a window without using keys? If not, why? Say I wanted to edit a file (vim file.py) in window 1, execute a file in window 2, and then ls -la a directory with window 3. Not being able to scroll defeats the purpose. Is there another program that can do this?

  • @siewmengtham5820
    @siewmengtham5820 2 роки тому

    Great video !!

  • @michaelkrailo5725
    @michaelkrailo5725 5 років тому

    Five star tutorial. I can actually read everything clearly due to the font size. What screen recording software do you use for doing your video's?

    • @linuxleech
      @linuxleech  5 років тому +1

      Hi Michael. I just use FFMpeg to do screen recordings.

  • @matiasgl
    @matiasgl 6 років тому

    Hi! Great video. Learnt a lot from it. Just a question. Can screen be used to replicate an action across several terminals? Let's say I have several machines in which I need to perform the same tasks. I'd ssh to them (each on a different pane) and then start typing commands or editing files. Is this possible? I'm aware of the "at # stuff ", but what if i want to edit (via vi command) a file? Would that be possible to edit all at once? Thanks!

    • @linuxleech
      @linuxleech  6 років тому +1

      Hi Matias, The first part of your question is definitely possible (connecting to several machines each in different panes). If you are looking to execute the same task on several machines at once I would recommend that you look at a tool called fabric www.fabfile.org/index.html .
      It is a python library but has a command-line tool. You will be able to specify the IP addresses of all of the machines that you want to run tasks on and have fabric run your tasks in parallel, on all of the machines that you specify.
      To make edits to files using vi/vim (assuming you want to make the same changes to the same files on all of your machines) You could download the file from one of them to your local machine make your edits, and then use fabric to upload to all of your machines in one go.
      As I mentioned earlier fabric is a python library you will need to write a little python to do the uploading/ downloading of files, but it isn't a lot, probably 15 short lines of python code would give you all of the functionality that you would need.
      To get you started with fabric you could try this:
      fab -H IPOfMachineOne, IPOfMachineTwo -u username -p password -- uptime
      That will run uptime on the two machines that you have provided IP addresses for.
      To run it in parallel just add -P so:
      fab -H IPOfMachineOne, IPOfMachineTwo -u username -p password -P -- uptime
      Hope that helps.

  • @itprosetal
    @itprosetal 4 роки тому

    This was an excellent tutorial. Thanks for sharing. Everything went fine except for the part about locking a session using cntl + a x. It won't accept my logon password. Any ideas?

  • @malariaviruz
    @malariaviruz 8 років тому

    great explanation! thx a lot.

  • @jimmienichols4895
    @jimmienichols4895 7 років тому +1

    New user here.... WOW!

  • @vadermemo
    @vadermemo 4 роки тому

    GREAT WORK, BUT when i use "ctrl + A + (N OR P)" doesnt work I am using aws ec2 server Any tip? thanks in advanced

  • @kulajit
    @kulajit 3 роки тому

    ctrl a+| (splits windows vertically) - somewhat does not work for me. Any other option?

  • @dick4042
    @dick4042 5 років тому

    thanks for making this

  • @3101freddy
    @3101freddy 4 роки тому

    I love it!

  • @maciejferenc9473
    @maciejferenc9473 4 роки тому

    Very useful, thx

  • @GlobalYoung7
    @GlobalYoung7 Рік тому

    thank you ❤😊

  • @RCD_K
    @RCD_K 5 років тому

    Awesome, Thanks

  • @RochieHD
    @RochieHD 6 років тому +1

    THANK YOU!!

  • @RussellTeapot
    @RussellTeapot 7 років тому +2

    How to use screen:
    Step 1) Don't use screen
    Step 2) Use tmux instead
    Jokes aside, great tutorial :D unfortunately for me, I'm using a "pre-installed" Virtual Machine which I can't connect properly to internet, so I can't install tmux on that... the only other option available on the system is screen, so this is why I'm here :)

    • @linuxleech
      @linuxleech  7 років тому +2

      I agree with your steps. But it is useful to know both. It is very common to not have access to install the tools you want to use. I guess in those situations the real question is multiplexer or nothing.

    • @RussellTeapot
      @RussellTeapot 7 років тому

      Yes, you are definitely right :) Indeed, I'm exactly in one of those situations :D

  • @JarppaGuru
    @JarppaGuru 2 роки тому

    it was cool 30 years ago. now you all have GUI you tab TAB your terminal emulator

  • @paveltretyakov7027
    @paveltretyakov7027 2 роки тому

    I will hearing "slash ls" in my dreams

  • @alexhanselmann2177
    @alexhanselmann2177 3 роки тому

    much appreciated

  • @wallaguest1
    @wallaguest1 4 роки тому

    okey very nice, but... meen, what a ball breaker linux is, if i must remember every command posiblity of every app...
    i end up someone with some attached and some detached sessions, i dont know the diference,

  • @megadrigter
    @megadrigter 6 років тому +1

    But how do I restore the split layout?

    • @WistrelChianti
      @WistrelChianti 5 років тому

      Indeed I've been wondering that today. I wonder if it's "a thing".

  • @xMario10
    @xMario10 5 років тому

    thank you

  • @seager3073
    @seager3073 7 років тому

    Thanks a lot every youtube tutorial is soooooooo bad and soooooooooooooooo stupid but this one is awesome

  • @khaled7472
    @khaled7472 4 роки тому

    ctrl a k does not work for me
    I read the man screen and it says ctrl a k should kill the screen, however, it does not work
    did anyone have similar problems
    ctrl a S also does not work while ctrl a n and ctrl a p and ctrl a c work fine

  • @josh429
    @josh429 6 років тому

    ctrl + ak didn't work for me. Ubuntu server 16.04

  • @ifreshdvideos5161
    @ifreshdvideos5161 6 років тому

    It says Screen command not found I'm using juicessh

  • @thevezz198
    @thevezz198 5 років тому

    Hello, please help. "screen -dmS litepack && screen -X -S litepack java -Xmx3G -jar fabric-server-launch.jar nogui" don't work.

    • @sivamachina3160
      @sivamachina3160 5 років тому

      Make a script to start your server. Make sure it works.
      Then run
      screen -dmS MC-server /path/to/script

    • @thevezz198
      @thevezz198 5 років тому

      @@sivamachina3160 I solved by creating a sh and setting it in the crontab.
      (Restart.sh)
      #! / Bin / bash
      screen -S server -X stuff "stop`echo -ne '05'`"
      sleep 30
      screen -S server -X stuff "bash ./start.sh` echo -ne '05'` "

  • @manikantas4837
    @manikantas4837 8 років тому

    I am unable to split screen vertically. Any idea what might be the problem?

    • @linuxleech
      @linuxleech  8 років тому

      Maybe your key bindings are not the default ones. try:
      ctrl +a : split -v
      I have also done a tutorial that specifically covers screen splitting ua-cam.com/video/bTbDxaGo4tA/v-deo.html
      Might be worth checking out

    • @manikantas4837
      @manikantas4837 8 років тому

      I tried with :split -v
      It says split: no arguments required
      I found this solution, It works : old.evanmeagher.net/2010/12/patching-screen-with-vertical-split-in-os

    • @holalluis
      @holalluis 7 років тому

      maybe you have an old version of screen, try to update it! That happened to me also

  • @AlexSeibz
    @AlexSeibz 6 років тому

    Another good tool is tmux and the ohmyzsh shell

  • @erdene-ochirmijid4040
    @erdene-ochirmijid4040 3 роки тому

    How to scroll multiply screen terminal?

    • @pythgoreansassistant2789
      @pythgoreansassistant2789 2 роки тому

      I had this problem too. "Control + a and [" will allow you to scroll using the "hjkl" keys similar to how vim works. Then press "Esc" to exit scrolling. I wanted to use screen for this exact purpose (cat files on one window & edit in another) but it doesn't appear to work that way.

  • @plutoneeum
    @plutoneeum 6 років тому +1

    yeah but what the purpose of screen. You jumped right into commands with no explanation at all.

    • @bobcat_the_Lion
      @bobcat_the_Lion 5 років тому +1

      The purpose is to get multiple screens when you are on a single terminal.
      For example you ssh into a server, and you want to edit a file in nano or vi, but meanwhile also do something like reading directory content. Normally that would be difficult. When you are in your editor, you can not give ls commands or start another program.
      This is when screen comes in handy. You can either split your terminal session, or switch between full-screen sessions. Screen makes it look like you have multiple screens.

  • @bloody789
    @bloody789 6 років тому

    Ctrl-a k not working :| why ?!

  • @fahadp7454
    @fahadp7454 Рік тому

    7:23 -- killing all windows, 'ctrl A + \ ' doesn't work for me, but doing 'ctrl A + ctrl \' works..

  • @markp844
    @markp844 4 роки тому

    Not sure why, But i am using PUTTY to ssh into a raspberry pi and some of the commands do not work like ctrl + a + k. Anyone know why?

  • @golvellius6855
    @golvellius6855 3 роки тому

    Watching video with pinhole
    Blocked over 100 ads

  • @fdfsdfsvsfgsg4888
    @fdfsdfsvsfgsg4888 4 роки тому +1

    I was trying to watch the UA-cam ads, but they kept being interrupted by brief, fleeting snippets of content.

  • @RaceForMoney
    @RaceForMoney 7 років тому

    Please, deleted "sudo" & Ubuntu

  • @amaxamon
    @amaxamon 4 роки тому

    This is like micro-emacs!