I am not sure if this has been mentioned before on this forum, but I always find 'Screen' is extremely useful for Linux boxes such as the Raspberry PI.
'Screen' is downloaded from the repositories with the command line -
sudo apt-get install screen
It allows you to create many terminal tty instances which can be connected to or disconnected from whenever or where-ever you want. So for example, you may want to download some large files or torrents which will take hours but don't want to leave your laptop connected to an SSH session whilst the download completes, you can use the 'screen' command to start a new terminal session then disconnect from it, close down your laptop and re-connect to the same session at a later time or from any other computer.
It's as simple as typing -
pi@raspberrypi:~$ screen bash
- to start a new screen session
To detach from a screen session press ctrl+a release and then d
To close and shutdown completely a screen session press ctrl+d
You can have multiple screen sessions running and see them all with 'screen -list' and then just re-attach to them with screen -r
I find it useful as I often kick something off first thing in the morning on my laptop at home, I can then come into work and monitor the session on my work laptop.
Hope someone finds this useful, I find it indispensable !
Re: "Screen" is very useful on the Pi !
The Raspberry Pi already has 6 virtual consoles accessible by Ctrl-Alt-(Console#)
{sig} Setup: Original version Raspberry Pi (B, rev1, 256MB), Dell 2001FP monitor (1600x1200), 8GB Class 4 SD Card with Raspbian and XBMC, DD-WRT wireless bridge
-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: "Screen" is very useful on the Pi !
Could I have "Totally Missing the Point" for $600, Alex?JeremyF wrote:The Raspberry Pi already has 6 virtual consoles accessible by Ctrl-Alt-(Console#)
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)
Re: "Screen" is very useful on the Pi !
Of course, but they are not accessible via SSH as I understand, I run my Pi headless.
Re: "Screen" is very useful on the Pi !
screen is one of those little Unix gems that I've known about for 20 years or more
although the ability to run multiple sessions on one terminal/screen/xterm whatever is not so useful in these GUI days (once upon a time i green screen land it was a godsend) what is really cool is that you can detach/attache screen sessions
What this means is you start a session on the GUI - start up screen, do what you need to do, then detach
Then you can log in remotely from anywhere on an ssh session and pick up the previous screen session from where you left it
And the screen session will survive an ssh or network drop out too - just log back in and reattach
Indeed I THINK you can share sessions too
although the ability to run multiple sessions on one terminal/screen/xterm whatever is not so useful in these GUI days (once upon a time i green screen land it was a godsend) what is really cool is that you can detach/attache screen sessions
What this means is you start a session on the GUI - start up screen, do what you need to do, then detach
Then you can log in remotely from anywhere on an ssh session and pick up the previous screen session from where you left it
And the screen session will survive an ssh or network drop out too - just log back in and reattach
Indeed I THINK you can share sessions too
Re: "Screen" is very useful on the Pi !
I've used it for many years, but was surprised when speaking to an "experienced" Linux developer* this morning that he had never heard of it. So I thought I would mention it here.
* - It's always good that even though I may be getting long in the tooth, I can still surprise even the brightest young developer with gems of wisdom !
* - It's always good that even though I may be getting long in the tooth, I can still surprise even the brightest young developer with gems of wisdom !
Re: "Screen" is very useful on the Pi !
This looks really useful thank you. I got stuck the other day when I ran a compile by ssh that took 3.5 hours (twice as long as I expected) and I had to leave my laptop on. I'm going to give this a go.cashaw wrote: It allows you to create many terminal tty instances which can be connected to or disconnected from whenever or where-ever you want. So for example, you may want to download some large files or torrents which will take hours but don't want to leave your laptop connected to an SSH session whilst the download completes, you can use the 'screen' command to start a new terminal session then disconnect from it, close down your laptop and re-connect to the same session at a later time or from any other computer.

Update: awesome - took me nearly 2 whole minutes to get this working and tested. Superb tip thanks

Alex Eames RasPi.TV, RasP.iO
Re: "Screen" is very useful on the Pi !
the best thing is to have a bashrc that connects you automatically. I don't have it here but I crafted a small script that re-attach your screen automatically. But I use my pi headless with keyboard (to make it even more complexe) so I use the multiuser function of screen
anyhow will post the whole experiment in a bit since it's even more complex and fun !

Re: "Screen" is very useful on the Pi !
Ah yes, sorry about that. In which case, yes. Screen is useful.cashaw wrote:Of course, but they are not accessible via SSH as I understand, I run my Pi headless.
{sig} Setup: Original version Raspberry Pi (B, rev1, 256MB), Dell 2001FP monitor (1600x1200), 8GB Class 4 SD Card with Raspbian and XBMC, DD-WRT wireless bridge
-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: "Screen" is very useful on the Pi !
I still say you've totally missed the point.JeremyF wrote:Ah yes, sorry about that. In which case, yes. Screen is useful.cashaw wrote:Of course, but they are not accessible via SSH as I understand, I run my Pi headless.
There are lots of advantages to screen, even in a GUI (headed, xterm, whatever terminology you favor) environment.
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)
Re: "Screen" is very useful on the Pi !
In addition to screen, when running with multiple SSH sessions, molly-guard can be a real livesaver. (aptitude install molly-guard). It asks you the name of the box you're trying to shutdown/reboot over SSH before shutting down the box at home instead of the local computer because you picked the wrong terminal.
-
- Posts: 1410
- Joined: Tue Aug 09, 2011 10:53 pm
Re: "Screen" is very useful on the Pi !
After spending quite some time on screen, I've been told tmux is where it's at now ?
Re: "Screen" is very useful on the Pi !
I use a thing called terminator in Ubuntu - handy for multi pane command line stuff - think it might be a bit like tmux - not sure it works on the Pi though. Just tried screen - like it.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.
Working in the Applications Team.
Re: "Screen" is very useful on the Pi !
Both are quite different, if you want multiwindow with mouse support with tab and more of a 'graphical' feel to it, tmux would be the choice. Screen seems stronger at multiuser and sessions attach detach, and a little less 'visually' oriented.. Two different beast, I found tmux easier to learn at first then switched to screen later on...obarthelemy wrote:After spending quite some time on screen, I've been told tmux is where it's at now ?
Re: "Screen" is very useful on the Pi !
I'm so pleased with SCREEN that I've made a blog post about it, mainly for beginners, complete with video installation and usage instructions. With a link back to this thread of course, as this is where i heard about it.
Thanks cashaw.
http://raspi.tv/2012/using-screen-with- ... sions-open
Let me know if I've messed anything up in the explanations.

http://raspi.tv/2012/using-screen-with- ... sions-open
Let me know if I've messed anything up in the explanations.

Alex Eames RasPi.TV, RasP.iO
Re: "Screen" is very useful on the Pi !
Have you ever been caught with a screen inside a screen inside a screen? It's like inception 

Re: "Screen" is very useful on the Pi !
I have been using Screen for ages and cant live without it and ssh to see what is going on...
I have a python pi project that I would like to run headless when the Pi starts (its a camera...). Within the program is a load of useful information that I display on the terminal which I would like to keep a track of.
What I would like to do is have an autostart sequence for the pi which starts an instance of "screen", then starts my python program so that later if I need to I can ssh in and see what is going on. Any ideas?
I have a python pi project that I would like to run headless when the Pi starts (its a camera...). Within the program is a load of useful information that I display on the terminal which I would like to keep a track of.
What I would like to do is have an autostart sequence for the pi which starts an instance of "screen", then starts my python program so that later if I need to I can ssh in and see what is going on. Any ideas?
-
- Posts: 690
- Joined: Tue Jun 16, 2015 6:01 am
Re: "Screen" is very useful on the Pi !
Screen and Tmux are both good. Try BYOBU though, it's a front end to screen and tmux. http://byobu.co/
Account Inactive
Re: "Screen" is very useful on the Pi !
Thanks, Ill do that.
Also found
https://coderwall.com/p/quflrg/run-a-sc ... spberry-pi
Which does what I want
Also found
https://coderwall.com/p/quflrg/run-a-sc ... spberry-pi
Which does what I want