Linked by Thom Holwerda on Thu 30th Aug 2012 23:11 UTC, submitted by MOS6510
Linux "You are logged into your remote server via SSH and happily plucking along at your keyboard and then it happens. Suddenly, the characters stop moving and then you get the dreaded 'Connection Closed' message. You have just lost your session. You were halfway through some task and now you have to start over. Ugh. Well you can prevent this from happening by using screen. The Linux screen tool can not only save you from disconnection disasters, but it also can increase your productivity by using multiple windows within one SSH session. I use this tool all of the time in our server management work." An older tutorial, and even though I have little to no knowledge about screen, I know one thing: lots of people swear by it.
Order by: Score:
Comment by Sodki
by Sodki on Thu 30th Aug 2012 23:06 UTC
Sodki
Member since:
2005-11-10

I swear by it. It's a _really_ powerful tool and easy to use if you just want basic functionality.

Reply Score: 9

Personally, I like tmux better.
by beowuff on Thu 30th Aug 2012 23:17 UTC
beowuff
Member since:
2006-07-26

But they are both awesome tools. I always recommend them to people new to cli.

Reply Score: 7

RE: Personally, I like tmux better.
by cb88 on Fri 31st Aug 2012 01:02 UTC in reply to "Personally, I like tmux better."
cb88 Member since:
2009-04-23

tmux really is better... I've used it extensively to keep the sessions on my sparcstation open even if the ssh connection craps out.

It would be nice if it were a bit more integrated into ssh so that it could resume connections automatic ie when on a cellular or intermittent wifi connection.

The keyboard usage on tmux seems a bit more polished to me I suppose thats the main thing.

Edited 2012-08-31 01:03 UTC

Reply Score: 6

broken_symlink Member since:
2005-07-06

I do this with screen, but I'm sure the same thing would probably work with tmux. Here's how, http://taint.org/wk/RemoteLoginAutoScreen

edit:
Someone already seems to have modified the above to work with tmux, http://william.shallum.net/random-notes/automatically-start-tmux-on...

Edited 2012-08-31 02:11 UTC

Reply Score: 2

tidux Member since:
2011-08-13

http://mosh.mit.edu/

That might be exactly what you're looking for.

Reply Score: 2

tmux
by Soulbender on Thu 30th Aug 2012 23:19 UTC
Soulbender
Member since:
2005-08-18

If you like screen you might want to have a look at tmux. It's like screen only with a modern design and actively maintained. I find it to work much better in general.

Reply Score: 10

RE: tmux
by Laurence on Fri 31st Aug 2012 07:44 UTC in reply to "tmux"
Laurence Member since:
2007-03-26

I'm another Tmux user as well.

Used to run GNU Screen heavily, then discovered Tmux and never looked back.

Reply Score: 3

Screen Mandatory Rails Tool
by jburnett on Thu 30th Aug 2012 23:25 UTC
jburnett
Member since:
2012-03-29

As a rails developer screen is a mandatory part of my toolkit. My only complaint is that I cannot seem to name the screens, so I have to remember which number is the server, console, vi session, etc... Does tmux have naming?

Reply Score: 1

RE: Screen Mandatory Rails Tool
by beowuff on Thu 30th Aug 2012 23:33 UTC in reply to "Screen Mandatory Rails Tool"
beowuff Member since:
2006-07-26

Yes!

From http://www.openbsd.org/cgi-bin/man.cgi?query=tmux&sektion=1

, Rename the current window.

Reply Score: 2

RE: Screen Mandatory Rails Tool
by Soulbender on Thu 30th Aug 2012 23:52 UTC in reply to "Screen Mandatory Rails Tool"
Soulbender Member since:
2005-08-18

Does tmux have naming?


Yes, it does but tmux also shows the current command next to each window number in the status bar.

Reply Score: 4

RE: Screen Mandatory Rails Tool
by JoeBuck on Fri 31st Aug 2012 00:24 UTC in reply to "Screen Mandatory Rails Tool"
JoeBuck Member since:
2006-01-11

screen can already do what you want. Enter C-a A to give the current window a name. Enter C-a ' (quote) to prompt for a window name to switch to. Enter C-a " (double quote) to list all the screen names/numbers.

Reply Score: 5

JoeBuck
Member since:
2006-01-11

Yes, RMS has tired everyone out by arguing that people could say GNU/Linux, but come on. It's not the Linux screen tool.

It is GNU Screen, originally done on the BSD platform and integrated with the GNU project in 1990, before Linus released his first kernel. People have been using it for more than two decades on all kinds of Unix flavors, as well as on Windows and OSX.

Linux is great, but it's just a kernel, and that kernel was designed originally to run all the cool GNU and BSD code that already existed.

Reply Score: 8

Moonbuzz Member since:
2005-07-09

No, he's absolutely correct. The name of the software is "GNU screen", not "screen". So while the whole GNU/Linux issue is debatable, calling "GNU screen" "Linux screen" is miss-attribution and wrong.

Reply Score: 9

karunko Member since:
2008-10-28

If that kind of thing pisses you off, you probably need to get out more. Seriously. Especially if you didn't even write the f**king thing.

Pardon me for the intrusion, but from were I stand it would appear that you are the one who's pissed off?

The O.P. is right and I was disappointed to see that, at least initially, he had been modded down just for putting things into perspective. And yes, I used (or rather, had to use) "screen" in the very early 90s... on SCO UNIX, no less! ;-)

Oh, and "screen" was great for TIA, aka The Internet Adapter (http://en.wikipedia.org/wiki/The_Internet_Adapter). Anyone remember that?


RT.

Edited 2012-08-31 07:48 UTC

Reply Score: 4

Used it all the time for admin tasks
by benali72 on Fri 31st Aug 2012 01:41 UTC
benali72
Member since:
2008-05-03

Excellent tool. As a sysadm, I used to use this all the time for remote connections, esp. for night work. These days connection reliability is so improved it's not the issue it once was.

Reply Score: 2

ndrw Member since:
2009-06-30

Actually, it is more a problem now than it has ever been before (maybe except for times of dial-up connections). I tend to work mostly on laptops, and switching between networks, suspending/waking up the machine, or simply losing a wireless connection happens all the time, often on purpose. Generally, relying on a TCP connection for holding the application state is a poor design decision these days.

BTW, this is also the main reason I don't use X for remote work nowadays. It was simply designed for a different use case (a server with fixed terminals). Another reason is that X with its networking performance issues, and without properly configured NFS/NIS, forwarded sound recording/playback, DBUS services, printers, CD-ROMs, card readers etc., is no longer network transparent but it still pretends to be (by mixing up local and remote windows).

Reply Score: 3

Screen...
by Almafeta on Fri 31st Aug 2012 02:45 UTC
Almafeta
Member since:
2007-02-22

As far as I've seen, the primary use of Screen is to run TinyFugue while you're at work.

Reply Score: 3

RE: Screen...
by Shane on Fri 31st Aug 2012 02:53 UTC in reply to "Screen..."
Shane Member since:
2005-07-06

12 or so years ago, I got introduced to Screen because I wanted to leave my nickname connected to IRC 24/7. Screened BitchX sessions, Eggdrop bots, riding netsplits to wage channel wars. Fun days.

Reply Score: 3

I prefer tmux
by Shane on Fri 31st Aug 2012 02:48 UTC
Shane
Member since:
2005-07-06

I switched from GNU Screen to tmux a few years back because I use vertical splits quite a lot and Screen didn't have that feature built in yet.

The first two things that I install on a new server are tmux and Vim.

Reply Score: 7

RE: I prefer tmux
by gan17 on Fri 31st Aug 2012 03:07 UTC in reply to "I prefer tmux"
gan17 Member since:
2008-06-03

Same for me, basically. Switched to tmux after years with screen. Was much easier to get into; partly due to prior experience with screen, mostly because it had clear documentation and didn't require me to be fluent in Klingon to configure it.

Reply Score: 9

RE: I prefer tmux
by diegoviola on Fri 31st Aug 2012 04:28 UTC in reply to "I prefer tmux"
diegoviola Member since:
2006-08-15

Another vote for tmux as well.

Reply Score: 3

Comment by MOS6510
by MOS6510 on Fri 31st Aug 2012 06:31 UTC
MOS6510
Member since:
2011-05-12

When I started out on the Internet it was all text and UNIX prompts for me. So when I discovered screen it was great.

TinyFugue
Pine (private)
Pine (work)
Tin
ircii
& a couple of shells to different servers.

My 'screen' ran at work, but as it was such a great tool more and more coworkers started using it causing system admins to get annoyed and we had to move server a few times. If you didn't a kill script would kill you (well, your screen session).

Reply Score: 3

.screenrc
by Risthel on Fri 31st Aug 2012 11:23 UTC
Risthel
Member since:
2010-12-22

hardstatus alwayslastline
hardstatus string '%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR} (%{W}%n*%f %t%?(%u)%?%{=b kR})%{= kw}%?%+Lw%?%?%= %{g}][%{Y}%l%{g}] %{=b C}[ %m/%d %c ]%{W}'


An then, you are good to go ;)

Reply Score: 1

Comment by OSbunny
by OSbunny on Fri 31st Aug 2012 12:21 UTC
OSbunny
Member since:
2009-05-23

Isn't screen obsolete now that we have GUIs everywhere? It's much easier to just open a new tab in Konsole (or your favourite terminal app) and make another SSH connection. If you are using Windows you just open up another putty window.

Reply Score: 0

RE: Comment by OSbunny
by ssokolow on Fri 31st Aug 2012 12:46 UTC in reply to "Comment by OSbunny"
ssokolow Member since:
2010-01-21

Isn't screen obsolete now that we have GUIs everywhere? It's much easier to just open a new tab in Konsole (or your favourite terminal app) and make another SSH connection. If you are using Windows you just open up another putty window.


Aside from terminals not having support for detaching and re-attaching sessions the way screen and tmux do, my responsive, lightweight terminals of choice (uxterm and urxvt) don't always do tabs.

(urxvt does, but it's basically a Perl script that does textual tabs in a manner inferior to screen or tmux)

Also, terminal tabs are less than ideal if you have to open a new SSH connection every time you Ctrl+Shift+T rather than just running screen on the remote system and doing Ctrl+a c.

Reply Score: 4

RE: Comment by OSbunny
by Soulbender on Fri 31st Aug 2012 14:56 UTC in reply to "Comment by OSbunny"
Soulbender Member since:
2005-08-18

Isn't screen obsolete now that we have GUIs everywhere?


No.

It's much easier to just open a new tab in Konsole (or your favourite terminal app) and make another SSH connection.


Pressing Ctrl-b+c is a lot quicker and easier than opening a new tab and making a new connection. Not to mention that the screen/tmux session survives disconnects.

Reply Score: 5

RE: Comment by OSbunny
by gilboa on Sun 2nd Sep 2012 16:29 UTC in reply to "Comment by OSbunny"
gilboa Member since:
2005-07-06

Say you run apt/yum from command line, using a konsole tab or putty and suddenly, gasp, you lose connection / your X session dies / SSH dies, etc. Recovery, if possible, will be -very- painful.

I never, never, never, never run anything destructive from a normal command prompt - I always use screen.

- Gilboa

Reply Score: 2

Is mosh not an option here?
by Gaius_Maximus on Fri 31st Aug 2012 15:13 UTC
Gaius_Maximus
Member since:
2012-08-31

I hear it's pretty good.

Reply Score: 1

RE: Is mosh not an option here?
by Soulbender on Sat 1st Sep 2012 03:49 UTC in reply to "Is mosh not an option here?"
Soulbender Member since:
2005-08-18

mosh is a replacement for ssh, not for tmux/screen. Well, it's an SSH replacement that, uh, uses SSH to work.

Reply Score: 2

Less-than-three screen
by StephenBeDoper on Fri 31st Aug 2012 20:11 UTC
StephenBeDoper
Member since:
2005-07-06

Started using screen after an OSNews article/link a few years ago, now I find it absolutely indispensable. Though it can get a bit disorienting sometimes, especially when working via remote desktop session running PuttyCM, with 3 or 4 tabs/connections open, each with at least 2 or 3 screens open.

My favourite trick with screen is using my smartphone to monitor a long-running process (E.g. rsync'ing a few GB of data from one server to another). I just start the process in a screen session via my desktop/laptop, then connect to the same account through SSH, and use "screen -x [session id]" to connect to the same session. The same strategy also works well for doing remote support/training via SSH (and much easier to setup that most desktop-sharing solutions I've used).

Reply Score: 2

Comment by marcp
by marcp on Fri 31st Aug 2012 20:40 UTC
marcp
Member since:
2007-11-23

I prefer to use TMUX. It's much more responsive, cleaner and generally better. Screen is kinda sluggish and old.

Reply Score: 2

Byobu, better screen
by vivainio on Sun 2nd Sep 2012 05:54 UTC
vivainio
Member since:
2008-12-26

I use Byobu

http://en.wikipedia.org/wiki/Byobu_(software)

Install and try it now, in 5 minutes you'll have forgotten the name ;-).

(copy paste the url, there is an osnews bug where last paren is stripped)

Edited 2012-09-02 05:57 UTC

Reply Score: 2