How to use GNU SCREEN - the Terminal Multiplexer - linux

Поделиться
HTML-код
  • Опубликовано: 2 фев 2025

Комментарии • 114

  • @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 5 месяцев назад

      @@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👏👏👏👏👏👏

  • @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

  • @ruixue6955
    @ruixue6955 3 года назад

    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

  • @Esparzamx
    @Esparzamx 6 лет назад +6

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

  • @johnblaisdell2179
    @johnblaisdell2179 3 года назад

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

  • @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 3 года назад

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

  • @LukasBeringer-ly5zd
    @LukasBeringer-ly5zd Месяц назад

    most usefull video ive seen all DAY

  • @hamedsarb
    @hamedsarb 8 лет назад +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.

  • @webdeveloper7994
    @webdeveloper7994 6 лет назад +1

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

  • @NinuRenee
    @NinuRenee 2 года назад +1

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

  • @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

  • @WistrelChianti
    @WistrelChianti 6 лет назад +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.

  •  5 лет назад +2

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

  • @zihanchen4312
    @zihanchen4312 4 года назад

    Very Clear and Detailed explaination. Thank you a lot!

  • @YanYong
    @YanYong 5 лет назад

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

  • @KeanuRevan
    @KeanuRevan 4 года назад

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

  • @damithdananjaya4617
    @damithdananjaya4617 4 года назад

    Great Tutorial

  • @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

  • @pythgoreansassistant2789
    @pythgoreansassistant2789 3 года назад

    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?

  • @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 .....?

  • @kulajit
    @kulajit 3 года назад

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

  • @matiasgl
    @matiasgl 7 лет назад

    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  7 лет назад +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.

  • @champnaman
    @champnaman 5 лет назад

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

  • @mahri233
    @mahri233 3 года назад

    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`

  • @mickeyp1291
    @mickeyp1291 6 лет назад +1

    best screen tutorial. learnt a lot thanks

  • @BurkeMcCabe
    @BurkeMcCabe 3 года назад +1

    Thank you, this was a very good 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.

  • @KendallVance
    @KendallVance 6 лет назад +2

    i finally really get screen! Thanks!

  • @jdev789
    @jdev789 8 лет назад +3

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

  • @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

  • @JaneSmine
    @JaneSmine 8 лет назад

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

  • @ashishkumarsingh4867
    @ashishkumarsingh4867 6 лет назад +3

    Simply awesome ...
    Thank you so much.

  • @ElectricSlevin
    @ElectricSlevin 5 лет назад

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

  • @sebastianmusat8857
    @sebastianmusat8857 Год назад

    very good material! thank you so much!

  • @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?

  • @ge0rgi5d
    @ge0rgi5d 8 лет назад +1

    Best tutorial on this topic :) Thanks

  • @kumargagare6154
    @kumargagare6154 3 года назад

    Great great tutorial 👍👍👍

  • @Aleks-x2i
    @Aleks-x2i Год назад

    Great video. Thank you!

  • @khaled7472
    @khaled7472 5 лет назад

    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

  • @michaelkrailo5725
    @michaelkrailo5725 6 лет назад

    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  6 лет назад +1

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

  • @1988mib
    @1988mib 5 лет назад

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

  • @fahadp7454
    @fahadp7454 Год назад

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

  • @umedina98
    @umedina98 2 года назад

    Very useful, thanks!

  • @frankl1
    @frankl1 6 лет назад

    Very clear tutorial.

  • @william.barela
    @william.barela 7 лет назад +2

    Thank you sooooooooo much! This is awesome.

  • @ArnoudRoeland
    @ArnoudRoeland 4 года назад

    Thank you very much, this helped a lot.

  • @arifdale
    @arifdale 5 лет назад

    Thanks for making this video!

  • @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 ruclips.net/video/bTbDxaGo4tA/видео.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

  • @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,

  • @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'` "

  • @siewmengtham5820
    @siewmengtham5820 3 года назад

    Great video !!

  • @GlobalYoung7
    @GlobalYoung7 2 года назад

    thank you ❤😊

  • @dradilashraf
    @dradilashraf 7 лет назад +1

    Very well done. Thanks

  • @benx05
    @benx05 5 лет назад

    Perfect tutorial.. two thumbs up :D

  • @josh429
    @josh429 6 лет назад

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

  • @dorotazelga
    @dorotazelga 7 лет назад

    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?

  • @malariaviruz
    @malariaviruz 8 лет назад

    great explanation! thx a lot.

  • @dick4042
    @dick4042 5 лет назад

    thanks for making this

  • @maciejferenc9473
    @maciejferenc9473 4 года назад

    Very useful, thx

  • @megadrifter
    @megadrifter 6 лет назад +1

    But how do I restore the split layout?

    • @WistrelChianti
      @WistrelChianti 6 лет назад

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

  • @ifreshdvideos5161
    @ifreshdvideos5161 6 лет назад

    It says Screen command not found I'm using juicessh

  • @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?

  • @RochieHD
    @RochieHD 6 лет назад +1

    THANK YOU!!

  • @3101freddy
    @3101freddy 4 года назад

    I love it!

  • @jimmienichols4895
    @jimmienichols4895 7 лет назад +1

    New user here.... WOW!

  • @xMario10
    @xMario10 5 лет назад

    thank you

  • @a_balanced_perspective
    @a_balanced_perspective 4 года назад

    How to scroll multiply screen terminal?

    • @pythgoreansassistant2789
      @pythgoreansassistant2789 3 года назад

      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.

  • @RCD_K
    @RCD_K 6 лет назад

    Awesome, Thanks

  • @alexhanselmann2177
    @alexhanselmann2177 3 года назад

    much appreciated

  • @bloody789
    @bloody789 6 лет назад

    Ctrl-a k not working :| why ?!

  • @seager3073
    @seager3073 7 лет назад

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

  • @benrowlinson
    @benrowlinson 3 года назад

    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.

  • @AlexSeibz
    @AlexSeibz 6 лет назад

    Another good tool is tmux and the ohmyzsh shell

  • @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

  • @paveltretyakov7027
    @paveltretyakov7027 2 года назад

    I will hearing "slash ls" in my dreams

  • @KayWillia
    @KayWillia 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.

  • @JarppaGuru
    @JarppaGuru 2 года назад

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

  • @fdfsdfsvsfgsg4888
    @fdfsdfsvsfgsg4888 5 лет назад +1

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

  • @golvellius6855
    @golvellius6855 3 года назад

    Watching video with pinhole
    Blocked over 100 ads

  • @RaceForMoney
    @RaceForMoney 7 лет назад

    Please, deleted "sudo" & Ubuntu

  • @amaxamon
    @amaxamon 4 года назад

    This is like micro-emacs!