Skip to content

Installing GNU Screen

This chapter delivers a working screen command and a way to prove it: the version printed, and the two configuration files every later chapter leans on, located and named.

First, check whether you already have it

Screen is old, small, and everywhere. Before installing anything:

command -v screen
screen --version

If both answer, you are done with this chapter. The lab machine's check is transcript screen-lab/transcripts/t00-version.txt:

$ screen --version
Screen version 4.09.01 (GNU) 20-Aug-23

$ command -v screen
/usr/bin/screen

Versions in the wild run from ancient 4.x builds on long-lived servers to the 5.x series released from 2024 on. Everything in this guide — sessions, windows, copy mode, the configuration file — behaves the same across them; where a key or feature differs by version, the chapter that uses it says so.

Installing it

Screen is a standard package on every Unix-like system. On Debian and Ubuntu:

sudo apt update
sudo apt install screen

The equivalents elsewhere: sudo dnf install screen on Fedora and its relatives, sudo pacman -S screen on Arch, sudo apk add screen on Alpine, and brew install screen on macOS with Homebrew. (macOS also ships an older Apple-built copy at /usr/bin/screen; the Homebrew one is newer, and having both is harmless as long as you know which your PATH finds first — command -v screen tells you.)

There is nothing to configure at install time and nothing to start: no daemon waits in the background. A Screen server exists only while one of your sessions does (chapter 2), started by the screen command itself.

The two configuration files

The package installs a global configuration, /etc/screenrc — settings for every user on the machine, mostly defaults with comments. The lab machine's is the distribution's own, and one of its lines matters to this guide: its defscrollback 1024 is where the lab's default scrollback size (chapters 7 and 8) came from.

Your own settings live in ~/.screenrc, which does not exist yet and does not need to: Screen runs happily without one. Chapter 8 builds one deliberately, line by line, once you know which defaults are worth bending. Create it early if you like, but an empty file and no file are the same thing — every behaviour in chapters 4 to 7 is stock Screen.

Check

screen --version prints a version, as in transcript t00. That, plus the next chapter's five minutes, is the whole installation: Screen is a tool from an era when "installing" a terminal program meant exactly this, and it has kept the habit.