Posts tagged screen
Since I forgot this so very often:
CTRL+a [ use PGUP + PGDN hit ENTER to escape again
This sequence starts logging, repeat it to stop logging again. From the manpage:
C-a H (log) Begins/ends logging of the current window to the file "screenlog.n".
See the folder where you started screen from for
This can be turned on/off, will append to an existing log file.
When wanting to share a screen between two people using the same console via the same user:
#1st user (via ssh) screen -S <sessionname> #in case the multiuser functionality is disabled: <ctrl-a>:multiuser on #2nd user (via ssh) screen -x <sessionname>
Now both people should be able to write into the same terminal.
According to its man page GNU screen is a
full-screen window manager that multiplexes a physical terminal between several processes [...] There is a scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows moving text regions between windows.
which sounds quite interesting.
All this means you can get several terminals into a single shell window. Other nice functions are detachable windows, which is a killer feature for unstable ssh sessions. Tmux (http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/) seems to be the the better alternative nowadays, but sometimes you might have to stick to screen.
will invoke the program. There are lots of options possible here, see
Ctrl-a is by default the global hotkey. All screen commands have to be prefixed with it.
In screen there exist windows and regions. Windows are like several shells running in parallel. Regions are like the two window areas when you use split screen.
Most important are:
? for help | for creating a vertical split region S for creating a horizontal split region tab for switching to another region w for showing a list of windows in the titlebar " for showing a list of windows in a window, use j or k and enter for navigating c for starting a new shell a for changing the buffer within a window X for killing a region (leaving the window alive) k for killing a window (leaving the region intact) \ for exiting screen
That is about it.
Open screen, create a region, switch to it, create a new shell window, be happy.
## create screen with session named '<sessionname>' screen -S <sessionname> ## detach a session (while running screen) ctrl-a d ## show available screen sessions screen -list ## reattach a session (from the shell) screen -r <sessionname> ## reattach if session wasn't detached earlier ## happens when you accidentally closed the window ## or when connection went broke screen -d -r <sessionname>
If you have to copy huge amounts of data or have other long running screen sessions that should not be interrupted, screen will have you covered, literally.
View posts from 2017-02, 2017-01, 2016-12, 2016-11, 2016-10, 2016-09, 2016-08, 2016-07, 2016-06, 2016-05, 2016-04, 2016-03, 2016-02, 2016-01, 2015-12, 2015-11, 2015-10, 2015-09, 2015-08, 2015-07, 2015-06, 2015-05, 2015-04, 2015-03, 2015-02, 2015-01, 2014-12, 2014-11, 2014-10, 2014-09, 2014-08, 2014-07, 2014-06, 2014-05, 2014-04, 2014-03, 2014-01, 2013-12, 2013-11, 2013-10