Back in the day, I used GNU Screen religiously when working on HP-UX. I’d SSH into a server, kick off a kernel build that would take hours, start a screen session, and ride my bike home. The next morning, I could reconnect and see if the build succeeded or failed overnight.
Screen is a terminal multiplexer - it lets you create multiple terminal windows within one session. The killer feature? Sessions persist even when you disconnect.
Why Screen Was Essential
When you’re working on remote servers, Screen solves a real problem. Network drops, laptop going to sleep, accidentally closing your terminal - none of that kills your running processes. You just reconnect and everything’s still there.
I used it for years for long-running kernel builds, deployment scripts, and SSH sessions to production servers.
Why I Switched to tmux
Eventually I moved from Screen to tmux. The core functionality is the same, but tmux has better defaults, easier configuration, and more active development. If you’re starting fresh today, I’d recommend tmux instead.
That said, Screen still works great and you’ll find it on almost any Unix system.
Essential Commands
Session Management
screen -S— create new sessionsscreen -x— attach to existing sessionscreen -d -r— reattach with forced detachment if neededscreen -d— detach from terminalscreen -list— display statusscreen -dr owner/sessionid.name— connect to another user’s session (root access required)
Within Screen
^a c— create new window^a d— detach from session^a spacebar— navigate to next window^a backspaceor^a del— navigate to previous window^a 2— jump to window 2^a w— list windows^a ^a— toggle between windows^a SHIFT-a— rename window
(^ represents Control key)
Configuration
Scrollback Buffer
By default, Screen has limited scrollback. To increase it, set this within a running session:
:scrollback 10000
Or add it to your ~/.screenrc:
| |
Status Line (.screenrc)
Here’s a useful status line configuration that shows window list, system info, and timestamp:
| |
This displays:
- Window list with current window highlighted
- Hostname
- Date and time
- Updates automatically
Getting Started
Screen comes pre-installed on most Unix systems. Just type screen to start a session.
The keybindings take some getting used to, but they become muscle memory fast. You can customize everything in a ~/.screenrc file.
Historical Note
This article is from 2010 when I was actively using Screen. I’ve since switched to tmux, but Screen still works great if you prefer it or need to work on systems where it’s already installed.