GNU Screen
January 20, 2014 — 0:14

Author: silver  Category: linux  Comments: Off

Screenshot:

This is how my current screen config looks, I use the same config on every host but with different colors for the status bar to quickly differentiate between them.
gnuscreen

Commands:

Move window:

  • change to the window you want to move
  • type (for example) ^x:number 1
  • ^x is the host key (usually ^a on most machines)
  • :number (typed literally) is the command
  • 1 the number to move the current screen to

Save log:

CTRL+a :

hardcopy -h

-or-

CTRL+a [
CTRL+a

:bufferfile /tmp/somefile.txt

CTRL+a >

Line wrap

<pre:wrap

Scrollback:

Press CTRL-a then : and then type

scrollback 10000

to get a 10000 line buffer, for example.

You can also set the default number of scrollback lines by adding

defscrollback 10000

to your ~/.screenrc file.

Another tip: CTRL-a i shows your current buffer setting.

List windows in tab:

CTRL+a w

Reload screenrc

CTRL-a : source $HOME/.screenrc

Fix ssh-agent:

Fix
“Could not open a connection to your authentication agent.”
“The agent has no identities.”

Cause: new socket/ppid

first detach/logout, then relogin with ssh -A and resume screen

export SSH_AUTH_SOCK=/tmp/ssh-oghop19109/agent.19109

CTRL+a: setenv SSH_AUTH_SOCK /tmp/ssh-oghop19109/agent.19109

ssh-add -l

My .screenrc:








We use Matomo free and open source web analytics
We also use Jetpack WordPress.com Stats which honors DNT