Movatterモバイル変換


[0]ホーム

URL:


GNU screen

GNU screen

Site Tools

Trace:quick_reference

SCREEN Quick Reference

Getting in

start a new screen session with session namescreen -S<name>
list running sessions/screensscreen -ls
attach to a running sessionscreen -x
attach to sessionnamescreen -r<name>
the “ultimate attach”screen -dRR (Attaches to a screen session. If the session is attached elsewhere, detaches that other display. If no session exists, creates one. If multiple sessions exist, uses the first one.)

Escape key

All screen commands are prefixed by an escape key, by defaultC-a(that's Control-a, sometimes written^a). To send a literalC-ato the programs in screen, useC-a a. This is useful when working with screen within screen. For exampleC-a a n will move screen to a new window on the screen within screen.

Getting out

detachC-a d
detach and logout (quick exit)C-a D D
exit screenC-a \ Exit all of the programs in screen. (not recommended)
force-exit screenC-a C-\ (not recommended)
getting out of the screen session exit

Window Management

create new windowC-a c
change to last-visited active windowC-a C-a (commonly used to flip-flop between two windows)
change to window by numberC-a <number> (only for windows 0 to 9)
change to window by number or nameC-a ' <number or title>
change to next window in listC-a n orC-a <space>
change to previous window in listC-a p orC-a <backspace>
see window listC-a " (allows you to select a window to change to)
show window barC-a w (if you don't have window bar)
close current window Close all applications in the current window (including shell)
kill current windowC-a k (not recommended)
kill all windowsC-a \ (not recommended)
rename current windowC-a A

Split screen

split display horizontallyC-a S
split display verticallyC-a | (orC-a V for the vanilla vertical screen patch)
jump to next display regionC-a tab
remove current regionC-a X
remove all regions but the current oneC-a Q

Clipboard and Navigation

freely navigate bufferC-a [ orC-a <esc>
toggle selection to copyspace
pasteC-a ]

Help

See helpC-a ? (lists keybindings)

Theman page is the complete reference.

Scripting

To any sessionname,

send a command to a named sessionscreen -S<name> -X<command>
create a new window and runping example.comscreen -S<name> -X screenping example.com
stuff characters into the input buffer
using bash to expand a newline character
(from here)
screen-S<name>[-p<page>]-X stuff $'quit\r'

A full example:

# run bash within screenscreen-AmdS bash_shellbash# run top within that bash sessionscreen-S bash_shell-p0-X stuff $'top\r' # ... some time later # stuff 'q' to tell top to quitscreen-S bash_shell-X stuff'q'# stuff 'exit\n' to exit bash sessionscreen-S bash_shell-X stuff $'exit\r'

Misc

redraw windowC-a C-l
monitor window for activityC-a M
monitor window for silenceC-a _
enter digraph (for producing non-ASCII characters)C-a C-v
lock (password protect) sessionC-a x
enter screen commandC-a :
enable logging in the screen sessionC-a H

Scrollback-buffer

In copy mode, one can navigate the scrollback buffer in various ways:

half page up C-u half page down C-d
back C-b forward C-f
cursor left/down/up/right h/j/k/l

User Tools

quick_reference.txt · Last edit was 2021-02-19 19:39 (external edit)

Warning: Undefined array key "gnugpl2+" in/home/public/screen/inc/template.php on line1532

[8]ページ先頭

©2009-2025 Movatter.jp