🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

GNU Screen Complete Guide: The Classic Terminal Multiplexer (2026)

GNU Screen Complete Guide: The Classic Terminal Multiplexer (2026)
GNU Screen Complete Guide

GNU Screen: The Classic Terminal Multiplexer

Sessions, windows, split regions, configuration & monitoring

Download Free Cheat Sheet (8-Page PDF)

GNU Screen has been the go-to terminal multiplexer since 1987. While tmux has gained popularity in recent years, Screen remains pre-installed on many servers and is the tool you'll find when nothing else is available. Knowing Screen is essential for any sysadmin.

Why Learn Screen?

Pre-installed Everywhere

Screen is available on virtually every Linux/Unix server. When you SSH into a bare-bones server with nothing installed, Screen is often already there.

Battle-Tested Reliability

Nearly 40 years of active use. Screen is extremely stable and handles edge cases gracefully. Your sessions won't crash.

Simple & Effective

Quick to learn, does what you need. Perfect for SSH sessions where you just need persistent terminals without complex setup.

Installation

# Ubuntu/Debian
sudo apt install screen

# CentOS/RHEL
sudo yum install screen

# macOS
brew install screen

# Check version
screen --version

Session Management

screen                    # Start new session
screen -S myserver        # Start named session
screen -ls                # List all sessions
screen -r myserver        # Reattach to session
screen -d -r myserver     # Detach elsewhere, reattach here
screen -x myserver        # Multi-attach (share session)
Shortcut Action
Ctrl+A, DDetach from session
Ctrl+A, \Kill all windows and quit

Important: Ctrl+A Conflict

Screen uses Ctrl+A as its prefix key, which conflicts with the Bash shortcut for "move to beginning of line." To send a literal Ctrl+A to the terminal, press Ctrl+A, A.

Window Management

Shortcut Action
Ctrl+A, CCreate new window
Ctrl+A, ARename current window
Ctrl+A, N / PNext / Previous window
Ctrl+A, 0-9Jump to window by number
Ctrl+A, "List windows interactively
Ctrl+A, KKill current window

Split Regions

Screen supports splitting, though it's less intuitive than tmux panes:

Shortcut Action
Ctrl+A, SSplit horizontally
Ctrl+A, |Split vertically
Ctrl+A, TabSwitch between regions
Ctrl+A, XClose current region
Ctrl+A, QClose all regions except current

Key Difference from tmux

When you split in Screen, the new region is empty. You must press Ctrl+A, C to create a new window in it or Ctrl+A, N to navigate an existing window into it. In tmux, splits automatically open a new shell.

Monitoring & Logging

Ctrl+A, M    # Toggle activity monitoring (alerts when output appears)
Ctrl+A, _    # Monitor for silence (alerts when output stops)
Ctrl+A, H    # Toggle logging to screenlog.N file

.screenrc Configuration

# Disable startup message
startup_message off

# Set scrollback buffer
defscrollback 10000

# Status bar
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m/%d %{W}%c %{g}]'

# Enable mouse scrollback (xterm)
termcapinfo xterm* ti@:te@

# Auto-detach on hangup
autodetach on

# Visual bell instead of audible
vbell on

Byobu: Screen Made Easy

Byobu is a wrapper around Screen (or tmux) that adds intuitive F-key shortcuts:

Key Action
F2Create new window
F3 / F4Previous / Next window
F6Detach
F8Rename window
Shift+F2Split horizontally
Ctrl+F2Split vertically

Download the Complete Cheat Sheet

Get all tmux, Screen, Byobu, and Zellij commands in a professionally designed 8-page PDF.

Download 8-Page Cheat Sheet (PDF)

Related Articles

Level Up Your Linux Skills

Browse our library of 200+ IT eBooks — Linux Administration, Bash Scripting, DevOps, Security, and more.

Browse All Books
Share this article:
Dorian Thorne
About the Author

Dorian Thorne

Cloud Infrastructure, Cloud Architecture, Infrastructure Automation, Technical Documentation

Dorian Thorne is a cloud infrastructure specialist and technical author focused on the design, deployment, and operation of scalable cloud-based systems.

He has extensive experience working with cloud platforms and modern infrastructure practices, including virtualized environments, cloud networking, identity and acces...

Cloud Computing Cloud Networking Identity and Access Management Infrastructure as Code System Reliability

Stay Updated

Subscribe to our newsletter for the latest tutorials, tips, and exclusive offers.