bubbl
Posts: 85
Joined: Sun Jul 14, 2013 9:15 pm
Location: United Kingdom
Contact: Website

Using Command Line like a boss with screen

Tue Dec 03, 2013 9:55 am

Hopefully, if you are using Linux command line, you've heard of screen. And if you've heard of it, chances are, you're already using it. I've wrote about one usage of screen on my previous blog post, explaining how to use it to access your Raspberry Pi via serial connection. Now, we're going to see what else can be done with this useful tool.

Screen is a terminal multiplexer. This means that you can start screen in one terminal and open any number of terminals inside that terminal. This lets you have several applications, like mutt, lynx, python client and a couple of spare shells, all open inside a single PuTTY/SSH connection. This is a great use of screen, but the benefits don't just end there. Thanks to screen you can run this time consuming package compilation you don't want to be interrupted in case your SSH connection gets flaky for any reason. You can just start it, exit screen and your SSH connection, and return later to see the progress. You can even run applications inside screen not having to change terminals constantly, log in and out, or to worry your X crashes. Screen is just there, as if above it all. It detaches from your actual console session. There is even more - it will auto-detach if the terminal it's in crashes or you logout. You can easily re-attach it at any time on any SSH, TTY or X session. The only major thing that will erase screen session is a reboot.

In my blogpost i cover:

1. Installation
2. Getting Started
3. Screen usage:
3.1. Opening windows within screen
3.2. Window navigation
3.3. Killing windows
3.4. Exiting screen
4. More screen voodoo:
4.1. Detaching/reattaching sessions
4.2. Locking screen
4.3. Naming/renaming screen sessions
4.4. Copy and paste
4.5. Renaming windows
4.6. Hardstatus line
4.7. Configuration file
5. Default key bindings

Read about screen here: http://www.bartbania.com/index.php/linux-screen/
We're not here because we are free. We're here because we are not free. There is no escaping reason. No denying purpose. Because we both know without purpose, we would not exist.
http://www.bartbania.com/

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26660
Joined: Sat Jul 30, 2011 7:41 pm

Re: Using Command Line like a boss with screen

Tue Dec 03, 2013 11:06 am

screen is one of my favourite things on Linux. Saves SO much time, especially when logging in and out of remote systems.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

bubbl
Posts: 85
Joined: Sun Jul 14, 2013 9:15 pm
Location: United Kingdom
Contact: Website

Re: Using Command Line like a boss with screen

Tue Dec 03, 2013 11:49 am

jamesh wrote:screen is one of my favourite things on Linux. Saves SO much time, especially when logging in and out of remote systems.
Indeed, it's a great tool. there is one more worth mentioning, tmux, some say it's better, but it's a matter of preference. I love screen for it's simplicity and ease of use.
We're not here because we are free. We're here because we are not free. There is no escaping reason. No denying purpose. Because we both know without purpose, we would not exist.
http://www.bartbania.com/

Return to “Beginners”