Which is Better, Tmux or Screen?
HTML-код
- Опубликовано: 12 окт 2020
- Tmux is better, but I still use screen. They both allow you to disconnect and reconnect to an active terminal session. Let's look at them both!
Here's the Tmux cheat sheet I mentioned: snar.co/tmux-cheatsheet
Check out my professional CBT Nuggets training at learn.gg/shawnp0wers
(You can get a free week of all-you-can-stream training!)
Have an idea for one of my tech tips? Lemme know in the comments!
#Linux #sysadmin #commandline - Наука
From Linux Journal to RUclips, I'm enjoying following your content. Thank You.
I did not know that was the purpose of screen. I used it as a serial (tty) terminal to access my Raspberry Pi Pico before i downloaded Rshell. Nice info!
Shawn Powers is an OG in the game. I have been following him from back in the days when he wrote articles in Linux Journal. Great to see his doing well.
I was having issues using nohup with rsync in that it would run for a while and then crash. I started using screen and then found this video. Fantastic!! I have been using Linux for about 20 years and am still learning about tools that can change my life. Thanks a bunch Shawn!😛
Very, very helpful, and appreciate your frankness about why you recommend TMUX even if your current muscle memory means you are currently stuck using SCREEN. New subscriber now!
Shawn Powers! Hello! Feels like I'm seeing an old friend after so long a time. Read Linux Journal religiously. Excellent articles!
Hi Dean! Ugh, LJ going away left such a huge hole my heart. I'm still pretty close with most of the core people who made it happen (I won't call them out, but all the names that come to mind when you think of the LJ good-old-days). I still miss it though.
I sometimes go back to the ruclips.net/user/linuxjournalonline channel and watch some of those silly old videos I did. It was over a decade ago now! Crazy...
ANYWAY, welcome! I'm glad you stopped by, and hope you stick around. I'm still the same guy, and it very much feels like just yesterday when writing the UpFront articles and answering letters to the editor were part of my everyday life.
This is a great overview, thank you for sharing it.
If you spend some time setting up a .screenrc or even multiple files for different tasks, one screen session may have multiple windows and layouts, layouts being vertical and horisonal splits, advanced keymappings, "menu" of windows as demonstrated in tmux, even execute programs for particular window. Hence, the sessions are maintained when disconnected and easy to restore if the session somehow ends (maybe because of reboot). Lots of examples of .screenrc if doing a search online. The gnu screen documentation may be helpful also. If a window has a ssh session, with the remote running a screen session as well, ctrl + a, then hit a again, will access the remote screen session shortcuts.
Common layouts may be included from separate files, having the same layouts for multiple sessions - the sky is the limit 😅
For the record, I haven't used tmux - been using screen for more than a decade.
^^^ This-I also use screen and it does everything shown in this video. The only difference I see is that Tmux has the status/menu bar out of the box whereas you have to turn it on with screen using your .screenrc file. But the tmux bar is very basic so you’d be doing customizations to it as well, so they seem mostly the same to me. When I get on a new system I just quickly download my screenrc before running screen and I have all my nice status info stuff and hostname and window listings. 😊
Great video! I'm new to Linux and this is really helpful!
Welcome! I still use screen every day for my DayJob. It's so convenient. :)
@@shawnp0wers I manage a small home network with it, and I attach to screens at my business from home and they take up right where they left off, with all the real time updates in between because the apps never stop.
Good one. thanks for sharing!
And thank YOU for watching. :)
Great video! Thank you!
Thanks Reginald!
Thank you excellent explanation!
Thanks for the great video :)
Thank you, Vikram!
Thank you
Nice. I've been using screen for years. I'll have to give tmux a shot.
I have to admit -- I still use screen. :D
@@shawnp0wers I'll probably stick with screen too. I've been using it for so long that the muscle memory for the keyboard shortcuts would be a challenge to unlearn. Like you said though, for a new person using such a tool, tmux is awfully attractive.
blew off my eardrum with the intro.
Would it be better to use screen or tmux to run a server program when using @reboot in crontab -e? I'm thinking tmux to avoid accidentally killing the process if you ssh into the server and forget to detach.
A coworker is using a production machine without tmux, and he doesn't want to make waves installing tmux, so he just asked Chat GPT to write a screenrc that maps keys to match tmux defaults as closely as possible.
Good information. Crazy eyes.
They say eyes are the window to the soul… 😜
So good I had to hit the subscribe button
Aww shucks! (Seriously though, thanks!) :)
Thanks for to-the-point presentation of both tmux and screen.
This video should be called: screen and tmux, what do they have in common?
They're both pretty awesome, that's for sure. :)
You can just install tmux and all the keyboard shortcuts.
byobu obviously
Imagine complaining that screen doesn't show a status line when you have the status line option disabled.
I wasn’t trying to complain. And if there’s a status bar option, I’d never seen it before. 🤷♂️
@@shawnp0wers Here's a sample `.screenrc` to get started:
defutf8 on on
defencoding utf8
backtick 1 2 2 ~/bin/cpu-temp
hardstatus alwayslastline
hardstatus string '%{= WK} %H C:%1` %{.W} %=%{= WK}%?%-w%?%{= rW}%n:%t%{= WK}%?%+w%?%{.W} %=%{= WK} %C %A, %D %d %M '
This will give you a status bar that shows the hostname, CPU temperature, the windows (the current window has a red background) and the time and date.
Please remove that patch hair; not working 4 u