πŸ•·οΈ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 72 (from laksa141)

2. Crawled Status Check

Query:
Response:

3. Robots.txt Check

Query:
Response:

4. Spam/Ban Check

Query:
Response:

5. Seen Status Check

ℹ️ Skipped - page is already crawled

πŸ“„
INDEXABLE
βœ…
CRAWLED
20 minutes ago
πŸ€–
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH0 months ago
History dropPASSisNull(history_drop_reason)No drop reason
Spam/banPASSfh_dont_index != 1 AND ml_spam_score = 0ml_spam_score=0
CanonicalPASSmeta_canonical IS NULL OR = '' OR = src_unparsedNot set

Page Details

PropertyValue
URLhttps://linuxize.com/post/how-to-use-linux-screen/
Last Crawled2026-04-15 12:06:06 (20 minutes ago)
First Indexed2018-06-11 18:22:56 (7 years ago)
HTTP Status Code200
Meta TitleHow to Use Linux Screen | Linuxize
Meta DescriptionGNU Screen is a terminal multiplexer for managing persistent sessions over SSH. This guide covers sessions, windows, detach/reattach, scrollback mode, and …
Meta Canonicalnull
Boilerpipe Text
Have you ever started a long task on a remote machine, only to lose your connection and see your SSH session end, taking all your progress with it? It is a common frustration for many of us. GNU Screen is a terminal multiplexer that solves exactly this β€” it keeps your sessions running even after you disconnect, so you can resume exactly where you left off. This guide explains how to install Screen, manage sessions and windows, detach and reattach, use scrollback mode, and customize Screen with a configuration file. tmux is a modern alternative to Screen with similar functionality and additional features like better window management and scripting support. Both tools are excellent choices for managing terminal sessions. Install Linux Screen The screen package is pre-installed on most Linux distributions. To check whether it is available, run: If screen is not installed on your system, install it using your distribution’s package manager. Install Linux Screen on Ubuntu, Debian, and Derivatives Install Linux Screen on Fedora, RHEL, and Derivatives Starting a Screen Session To start a new Screen session, type the following in your terminal: This opens a Screen session, creates a new window, and starts a shell in it. To see all available key bindings, press Ctrl+a ? from within the session. Starting a Named Session Named sessions are useful when you run multiple screen sessions at the same time. To create a named session, run: It is always a good idea to choose a descriptive session name that reflects the task running in it. This makes it easier to identify and manage multiple sessions later. Working with Screen Windows When you start a new Screen session, it creates a single window with a shell in it. You can open additional windows inside the same session at any time. To create a new window, press Ctrl+a c . Screen assigns the first available number in the range 0–9 to the new window. Here are the most common key bindings for managing windows: Ctrl+a c β€” Create a new window (with shell). Ctrl+a " β€” List all windows. Ctrl+a 0 β€” Switch to window 0 (by number). Ctrl+a A β€” Rename the current window. Ctrl+a k β€” Kill the current window. Ctrl+a S β€” Split the current region horizontally into two regions. Ctrl+a | β€” Split the current region vertically into two regions. Ctrl+a Tab β€” Switch the input focus to the next region. Ctrl+a Ctrl+a β€” Toggle between the current and previous window. Ctrl+a Q β€” Close all regions except the current one. Ctrl+a X β€” Close the current region. Detach from a Screen Session You can detach from the screen session at any time by pressing: Ctrl+a d The programs running inside the session continue to run after you detach. You can safely close your terminal or disconnect your SSH session. Reattach to a Screen Session To resume a detached session, run: If you have multiple screen sessions running, you need to specify the session ID. To list all running sessions, run: To reattach to a specific session, pass its ID to the -r option: If a session is still marked as (Attached) β€” for example after an unexpected disconnect β€” use -d -r to detach it first and then reattach: By default, Screen does not allow scrolling with the mouse wheel. To scroll through previous output, enter scrollback mode by pressing: Ctrl+a [ In scrollback mode, use the arrow keys or Page Up / Page Down to navigate through the output buffer. To copy text, press Space to mark the start of the selection, move the cursor to the end, and press Space again to copy. To paste the copied text, press: Ctrl+a ] Press q or Escape to exit scrollback mode without copying. Kill a Screen Session To close a Screen session cleanly, type exit in each open window. When the last window is closed, the session ends automatically. To force-kill a named session from outside, use the -X flag to send the quit command: To kill a session by ID, replace session_name with the session ID shown by screen -ls . Customize Linux Screen When Screen starts, it reads its configuration from /etc/screenrc and ~/.screenrc . You can modify the default settings by editing ~/.screenrc . Here is a sample configuration with a customized status line and a few useful options: Quick Reference Session commands: Command Description screen Start a new session screen -S name Start a named session screen -ls List all sessions screen -r Reattach to a detached session screen -r session_id Reattach by session ID screen -d -r session_id Detach and reattach to a session screen -X -S name quit Force kill a named session Key bindings (inside a session): Key binding Description Ctrl+a c Create a new window Ctrl+a " List all windows Ctrl+a 0–9 Switch to window by number Ctrl+a A Rename the current window Ctrl+a k Kill the current window Ctrl+a d Detach from session Ctrl+a [ Enter scrollback mode Ctrl+a ] Paste from scrollback buffer Ctrl+a ? Show all key bindings For a printable quick reference, see the Screen cheatsheet . Troubleshooting There is no screen to be resumed No detached sessions exist. Run screen -ls to view all sessions. If the session shows (Attached) , use screen -d -r session_id to detach it from the stale connection and reattach. Must run suid root for multiuser support The screen binary does not have the required permissions. On Ubuntu and Debian, reinstall the package to restore them: sudo apt reinstall screen . Cannot reattach to a session created by another user Screen sessions are user-specific. You must be logged in as the same user who created the session. To share a session across users, enable multiuser mode inside Screen with Ctrl+a :multiuser on and then grant access with Ctrl+a :acladd username . FAQ What is the difference between Screen and tmux? Both are terminal multiplexers that keep sessions alive after disconnecting. tmux has a more active development cycle, cleaner configuration, and better pane management. Screen is more widely pre-installed. For new setups, tmux is generally the better choice. How do I scroll up in Screen? Press Ctrl+a [ to enter scrollback mode, then use the arrow keys or Page Up / Page Down to navigate. Press q or Escape to exit. How do I share a Screen session between two users? From inside the session, run Ctrl+a :multiuser on and then Ctrl+a :acladd username . The other user can then attach with screen -x session_id . How do I log a Screen session to a file? Press Ctrl+a H to toggle logging. Screen writes output to a file named screenlog.N in your home directory, where N is the window number. Conclusion GNU Screen lets you keep terminal sessions alive across disconnections, run multiple windows in a single session, and resume work exactly where you left off. Use screen -S name to create named sessions, Ctrl+a d to detach, and screen -r to reattach from any terminal. If you have any questions, feel free to leave a comment below. Tags Linuxize Weekly Newsletter A quick weekly roundup of new tutorials, news, and tips. Unsubscribe anytime. We respect your inbox. About the authors Dejan Panovski Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides. View author page
Markdown
[Skip to main content](https://linuxize.com/post/how-to-use-linux-screen/#main-content) [Start Here](https://linuxize.com/start-here/) [Linux Commands](https://linuxize.com/tags/linux-commands/) [Bash](https://linuxize.com/tags/bash/) [Ubuntu](https://linuxize.com/tags/ubuntu/) [Python](https://linuxize.com/tags/python/) [Series](https://linuxize.com/series/) [Cheatsheets](https://linuxize.com/cheatsheet/) [About](https://linuxize.com/about/) Search `/` - [Start Here](https://linuxize.com/start-here/) - [Linux Commands](https://linuxize.com/tags/linux-commands/) - [Bash](https://linuxize.com/tags/bash/) - [Ubuntu](https://linuxize.com/tags/ubuntu/) - [Python](https://linuxize.com/tags/python/) - [Series](https://linuxize.com/series/) - [Cheatsheets](https://linuxize.com/cheatsheet/) - [About](https://linuxize.com/about/) 1. [Home](https://linuxize.com/) 2. / [linux commands](https://linuxize.com/tags/linux-commands/) 3. / How to Use Linux Screen # How to Use Linux Screen By [Dejan Panovski](https://linuxize.com/authors/dejan-panovski/) β€’ Updated on Feb 20, 2026 β€’ 7 min read On this page - [Install Linux Screen](https://linuxize.com/post/how-to-use-linux-screen/#install-linux-screen) - [Install Linux Screen on Ubuntu, Debian, and Derivatives](https://linuxize.com/post/how-to-use-linux-screen/#install-linux-screen-on-ubuntu-debian-and-derivatives) - [Install Linux Screen on Fedora, RHEL, and Derivatives](https://linuxize.com/post/how-to-use-linux-screen/#install-linux-screen-on-fedora-rhel-and-derivatives) - [Starting a Screen Session](https://linuxize.com/post/how-to-use-linux-screen/#starting-a-screen-session) - [Starting a Named Session](https://linuxize.com/post/how-to-use-linux-screen/#starting-a-named-session) - [Working with Screen Windows](https://linuxize.com/post/how-to-use-linux-screen/#working-with-screen-windows) - [Detach from a Screen Session](https://linuxize.com/post/how-to-use-linux-screen/#detach-from-a-screen-session) - [Reattach to a Screen Session](https://linuxize.com/post/how-to-use-linux-screen/#reattach-to-a-screen-session) - [Scrollback and Copy Mode](https://linuxize.com/post/how-to-use-linux-screen/#scrollback-and-copy-mode) - [Kill a Screen Session](https://linuxize.com/post/how-to-use-linux-screen/#kill-a-screen-session) - [Customize Linux Screen](https://linuxize.com/post/how-to-use-linux-screen/#customize-linux-screen) - [Quick Reference](https://linuxize.com/post/how-to-use-linux-screen/#quick-reference) - [Troubleshooting](https://linuxize.com/post/how-to-use-linux-screen/#troubleshooting) - [FAQ](https://linuxize.com/post/how-to-use-linux-screen/#faq) - [Conclusion](https://linuxize.com/post/how-to-use-linux-screen/#conclusion) Show full outline Share ![GNU Screen terminal multiplexer managing multiple sessions in Linux](https://linuxize.com/post/how-to-use-linux-screen/featured_hu_2b08960f7bcd15ef.jpg) Have you ever started a long task on a remote machine, only to lose your connection and see your SSH session end, taking all your progress with it? It is a common frustration for many of us. GNU Screen is a terminal multiplexer that solves exactly this β€” it keeps your sessions running even after you disconnect, so you can resume exactly where you left off. This guide explains how to install Screen, manage sessions and windows, detach and reattach, use scrollback mode, and customize Screen with a configuration file. Tip [tmux](https://linuxize.com/post/getting-started-with-tmux/) is a modern alternative to Screen with similar functionality and additional features like better window management and scripting support. Both tools are excellent choices for managing terminal sessions. ## Install Linux Screen [\#](https://linuxize.com/post/how-to-use-linux-screen/#install-linux-screen) The screen package is pre-installed on most Linux distributions. To check whether it is available, run: Terminal ``` screen --version ``` output ``` Screen version 4.09.01 (GNU) 20-Aug-23 ``` If screen is not installed on your system, install it using your distribution’s package manager. ### Install Linux Screen on Ubuntu, Debian, and Derivatives [\#](https://linuxize.com/post/how-to-use-linux-screen/#install-linux-screen-on-ubuntu-debian-and-derivatives) Terminal ``` sudo apt update && sudo apt install screen ``` ### Install Linux Screen on Fedora, RHEL, and Derivatives [\#](https://linuxize.com/post/how-to-use-linux-screen/#install-linux-screen-on-fedora-rhel-and-derivatives) Terminal ``` sudo dnf install screen ``` ## Starting a Screen Session [\#](https://linuxize.com/post/how-to-use-linux-screen/#starting-a-screen-session) To start a new Screen session, type the following in your terminal: Terminal ``` screen ``` This opens a Screen session, creates a new window, and starts a shell in it. To see all available key bindings, press `Ctrl+a` `?` from within the session. ### Starting a Named Session [\#](https://linuxize.com/post/how-to-use-linux-screen/#starting-a-named-session) Named sessions are useful when you run multiple screen sessions at the same time. To create a named session, run: Terminal ``` screen -S session_name ``` It is always a good idea to choose a descriptive session name that reflects the task running in it. This makes it easier to identify and manage multiple sessions later. ## Working with Screen Windows [\#](https://linuxize.com/post/how-to-use-linux-screen/#working-with-screen-windows) When you start a new Screen session, it creates a single window with a shell in it. You can open additional windows inside the same session at any time. To create a new window, press `Ctrl+a` `c`. Screen assigns the first available number in the range `0–9` to the new window. Here are the most common key bindings for managing windows: - `Ctrl+a` `c` β€” Create a new window (with shell). - `Ctrl+a` `"` β€” List all windows. - `Ctrl+a` `0` β€” Switch to window 0 (by number). - `Ctrl+a` `A` β€” Rename the current window. - `Ctrl+a` `k` β€” Kill the current window. - `Ctrl+a` `S` β€” Split the current region horizontally into two regions. - `Ctrl+a` `|` β€” Split the current region vertically into two regions. - `Ctrl+a` `Tab` β€” Switch the input focus to the next region. - `Ctrl+a` `Ctrl+a` β€” Toggle between the current and previous window. - `Ctrl+a` `Q` β€” Close all regions except the current one. - `Ctrl+a` `X` β€” Close the current region. ## Detach from a Screen Session [\#](https://linuxize.com/post/how-to-use-linux-screen/#detach-from-a-screen-session) You can detach from the screen session at any time by pressing: `Ctrl+a` `d` The programs running inside the session continue to run after you detach. You can safely close your terminal or disconnect your SSH session. ## Reattach to a Screen Session [\#](https://linuxize.com/post/how-to-use-linux-screen/#reattach-to-a-screen-session) To resume a detached session, run: Terminal ``` screen -r ``` If you have multiple screen sessions running, you need to specify the session ID. To list all running sessions, run: Terminal ``` screen -ls ``` output ``` There are screens on: 10835.pts-0.linuxize-desktop (Detached) 10366.pts-0.linuxize-desktop (Detached) 2 Sockets in /run/screens/S-linuxize. ``` To reattach to a specific session, pass its ID to the `-r` option: Terminal ``` screen -r 10835 ``` If a session is still marked as `(Attached)` β€” for example after an unexpected disconnect β€” use `-d -r` to detach it first and then reattach: Terminal ``` screen -d -r 10835 ``` ## Scrollback and Copy Mode [\#](https://linuxize.com/post/how-to-use-linux-screen/#scrollback-and-copy-mode) By default, Screen does not allow scrolling with the mouse wheel. To scroll through previous output, enter scrollback mode by pressing: `Ctrl+a` `[` In scrollback mode, use the arrow keys or `Page Up` / `Page Down` to navigate through the output buffer. To copy text, press `Space` to mark the start of the selection, move the cursor to the end, and press `Space` again to copy. To paste the copied text, press: `Ctrl+a` `]` Press `q` or `Escape` to exit scrollback mode without copying. ## Kill a Screen Session [\#](https://linuxize.com/post/how-to-use-linux-screen/#kill-a-screen-session) To close a Screen session cleanly, type `exit` in each open window. When the last window is closed, the session ends automatically. To force-kill a named session from outside, use the `-X` flag to send the `quit` command: Terminal ``` screen -X -S session_name quit ``` To kill a session by ID, replace `session_name` with the session ID shown by `screen -ls`. ## Customize Linux Screen [\#](https://linuxize.com/post/how-to-use-linux-screen/#customize-linux-screen) When Screen starts, it reads its configuration from `/etc/screenrc` and `~/.screenrc`. You can modify the default settings by editing `~/.screenrc`. Here is a sample configuration with a customized status line and a few useful options: ~/.screenrccfg ``` # Turn off the welcome message startup_message off # Disable visual bell vbell off # Set scrollback buffer to 10000 defscrollback 10000 # Customize the status line 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}]' ``` ![GNU Screen terminal with customized status line](https://linuxize.com/post/how-to-use-linux-screen/gnu-screen-terminal_hu_11f82149158e4f84.jpg) ## Quick Reference [\#](https://linuxize.com/post/how-to-use-linux-screen/#quick-reference) **Session commands:** | Command | Description | |---|---| | `screen` | Start a new session | | `screen -S name` | Start a named session | | `screen -ls` | List all sessions | | `screen -r` | Reattach to a detached session | | `screen -r session_id` | Reattach by session ID | | `screen -d -r session_id` | Detach and reattach to a session | | `screen -X -S name quit` | Force kill a named session | **Key bindings (inside a session):** | Key binding | Description | |---|---| | `Ctrl+a` `c` | Create a new window | | `Ctrl+a` `"` | List all windows | | `Ctrl+a` `0–9` | Switch to window by number | | `Ctrl+a` `A` | Rename the current window | | `Ctrl+a` `k` | Kill the current window | | `Ctrl+a` `d` | Detach from session | | `Ctrl+a` `[` | Enter scrollback mode | | `Ctrl+a` `]` | Paste from scrollback buffer | | `Ctrl+a` `?` | Show all key bindings | For a printable quick reference, see the [Screen cheatsheet](https://linuxize.com/cheatsheet/screen/) . ## Troubleshooting [\#](https://linuxize.com/post/how-to-use-linux-screen/#troubleshooting) **`There is no screen to be resumed`** No detached sessions exist. Run `screen -ls` to view all sessions. If the session shows `(Attached)`, use `screen -d -r session_id` to detach it from the stale connection and reattach. **`Must run suid root for multiuser support`** The screen binary does not have the required permissions. On Ubuntu and Debian, reinstall the package to restore them: `sudo apt reinstall screen`. **Cannot reattach to a session created by another user** Screen sessions are user-specific. You must be logged in as the same user who created the session. To share a session across users, enable multiuser mode inside Screen with `Ctrl+a` `:multiuser on` and then grant access with `Ctrl+a` `:acladd username`. ## FAQ [\#](https://linuxize.com/post/how-to-use-linux-screen/#faq) **What is the difference between Screen and tmux?** Both are terminal multiplexers that keep sessions alive after disconnecting. tmux has a more active development cycle, cleaner configuration, and better pane management. Screen is more widely pre-installed. For new setups, tmux is generally the better choice. **How do I scroll up in Screen?** Press `Ctrl+a` `[` to enter scrollback mode, then use the arrow keys or `Page Up` / `Page Down` to navigate. Press `q` or `Escape` to exit. **How do I share a Screen session between two users?** From inside the session, run `Ctrl+a` `:multiuser on` and then `Ctrl+a` `:acladd username`. The other user can then attach with `screen -x session_id`. **How do I log a Screen session to a file?** Press `Ctrl+a` `H` to toggle logging. Screen writes output to a file named `screenlog.N` in your home directory, where `N` is the window number. ## Conclusion [\#](https://linuxize.com/post/how-to-use-linux-screen/#conclusion) GNU Screen lets you keep terminal sessions alive across disconnections, run multiple windows in a single session, and resume work exactly where you left off. Use `screen -S name` to create named sessions, `Ctrl+a` `d` to detach, and `screen -r` to reattach from any terminal. If you have any questions, feel free to leave a comment below. ## Tags [linux commands](https://linuxize.com/tags/linux-commands/) ## Linuxize Weekly Newsletter A quick weekly roundup of new tutorials, news, and tips. ## About the authors ![Dejan Panovski](https://linuxize.com/images/authors/dejan-panovski.jpg) Dejan Panovski Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides. [View author page](https://linuxize.com/authors/dejan-panovski/) ## More Like This - [git cherry-pick Command: Apply Commits from Another Branch](https://linuxize.com/post/git-cherry-pick/) - [ufw Command in Linux: Uncomplicated Firewall Reference](https://linuxize.com/post/ufw-command-in-linux/) - [nslookup Command in Linux: Query DNS Records](https://linuxize.com/post/nslookup-command-in-linux/) - [env Command in Linux: Show and Set Environment Variables](https://linuxize.com/post/env-command-in-linux/) - [htop Command in Linux: Monitor Processes Interactively](https://linuxize.com/post/htop-command-in-linux/) ## You May Also Like [Apr 9, 2026 β€’ 4 min read file Command in Linux: Determine File Types Identify file types from the command line using the Linux file command. Covers basic usage, MIME types, compressed files, symlinks, and the magic database.](https://linuxize.com/post/linux-file-command/) [Mar 12, 2026 β€’ 7 min read How to Rename Files and Directories in Linux Rename files and directories in Linux using mv for single renames and rename for batch filename changes, including extension changes, case conversion, and safe previews.](https://linuxize.com/post/how-to-rename-files-in-linux/) [Jan 22, 2026 β€’ 2 min read Linux Time Command This guide shows how to use the Linux time command to measure execution time, explains real/user/sys, and covers Bash, Zsh, and GNU time.](https://linuxize.com/post/linux-time-command/) ## Comments Β© 2026 Linuxize.com \| A Raptive Partner Site [Write For Us](https://linuxize.com/write-for-us/) [Support Us](https://linuxize.com/donate/) [Privacy Policy](https://linuxize.com/privacy-policy/) [Editorial Policy](https://linuxize.com/editorial-policy/) [Terms](https://linuxize.com/terms-of-service/) [Contact](https://linuxize.com/contact/)
Readable Markdown
Have you ever started a long task on a remote machine, only to lose your connection and see your SSH session end, taking all your progress with it? It is a common frustration for many of us. GNU Screen is a terminal multiplexer that solves exactly this β€” it keeps your sessions running even after you disconnect, so you can resume exactly where you left off. This guide explains how to install Screen, manage sessions and windows, detach and reattach, use scrollback mode, and customize Screen with a configuration file. [tmux](https://linuxize.com/post/getting-started-with-tmux/) is a modern alternative to Screen with similar functionality and additional features like better window management and scripting support. Both tools are excellent choices for managing terminal sessions. ## Install Linux Screen The screen package is pre-installed on most Linux distributions. To check whether it is available, run: If screen is not installed on your system, install it using your distribution’s package manager. ### Install Linux Screen on Ubuntu, Debian, and Derivatives ### Install Linux Screen on Fedora, RHEL, and Derivatives ## Starting a Screen Session To start a new Screen session, type the following in your terminal: This opens a Screen session, creates a new window, and starts a shell in it. To see all available key bindings, press `Ctrl+a` `?` from within the session. ### Starting a Named Session Named sessions are useful when you run multiple screen sessions at the same time. To create a named session, run: It is always a good idea to choose a descriptive session name that reflects the task running in it. This makes it easier to identify and manage multiple sessions later. ## Working with Screen Windows When you start a new Screen session, it creates a single window with a shell in it. You can open additional windows inside the same session at any time. To create a new window, press `Ctrl+a` `c`. Screen assigns the first available number in the range `0–9` to the new window. Here are the most common key bindings for managing windows: - `Ctrl+a` `c` β€” Create a new window (with shell). - `Ctrl+a` `"` β€” List all windows. - `Ctrl+a` `0` β€” Switch to window 0 (by number). - `Ctrl+a` `A` β€” Rename the current window. - `Ctrl+a` `k` β€” Kill the current window. - `Ctrl+a` `S` β€” Split the current region horizontally into two regions. - `Ctrl+a` `|` β€” Split the current region vertically into two regions. - `Ctrl+a` `Tab` β€” Switch the input focus to the next region. - `Ctrl+a` `Ctrl+a` β€” Toggle between the current and previous window. - `Ctrl+a` `Q` β€” Close all regions except the current one. - `Ctrl+a` `X` β€” Close the current region. ## Detach from a Screen Session You can detach from the screen session at any time by pressing: `Ctrl+a` `d` The programs running inside the session continue to run after you detach. You can safely close your terminal or disconnect your SSH session. ## Reattach to a Screen Session To resume a detached session, run: If you have multiple screen sessions running, you need to specify the session ID. To list all running sessions, run: To reattach to a specific session, pass its ID to the `-r` option: If a session is still marked as `(Attached)` β€” for example after an unexpected disconnect β€” use `-d -r` to detach it first and then reattach: By default, Screen does not allow scrolling with the mouse wheel. To scroll through previous output, enter scrollback mode by pressing: `Ctrl+a` `[` In scrollback mode, use the arrow keys or `Page Up` / `Page Down` to navigate through the output buffer. To copy text, press `Space` to mark the start of the selection, move the cursor to the end, and press `Space` again to copy. To paste the copied text, press: `Ctrl+a` `]` Press `q` or `Escape` to exit scrollback mode without copying. ## Kill a Screen Session To close a Screen session cleanly, type `exit` in each open window. When the last window is closed, the session ends automatically. To force-kill a named session from outside, use the `-X` flag to send the `quit` command: To kill a session by ID, replace `session_name` with the session ID shown by `screen -ls`. ## Customize Linux Screen When Screen starts, it reads its configuration from `/etc/screenrc` and `~/.screenrc`. You can modify the default settings by editing `~/.screenrc`. Here is a sample configuration with a customized status line and a few useful options: ## Quick Reference **Session commands:** | Command | Description | |---|---| | `screen` | Start a new session | | `screen -S name` | Start a named session | | `screen -ls` | List all sessions | | `screen -r` | Reattach to a detached session | | `screen -r session_id` | Reattach by session ID | | `screen -d -r session_id` | Detach and reattach to a session | | `screen -X -S name quit` | Force kill a named session | **Key bindings (inside a session):** | Key binding | Description | |---|---| | `Ctrl+a` `c` | Create a new window | | `Ctrl+a` `"` | List all windows | | `Ctrl+a` `0–9` | Switch to window by number | | `Ctrl+a` `A` | Rename the current window | | `Ctrl+a` `k` | Kill the current window | | `Ctrl+a` `d` | Detach from session | | `Ctrl+a` `[` | Enter scrollback mode | | `Ctrl+a` `]` | Paste from scrollback buffer | | `Ctrl+a` `?` | Show all key bindings | For a printable quick reference, see the [Screen cheatsheet](https://linuxize.com/cheatsheet/screen/) . ## Troubleshooting **`There is no screen to be resumed`** No detached sessions exist. Run `screen -ls` to view all sessions. If the session shows `(Attached)`, use `screen -d -r session_id` to detach it from the stale connection and reattach. **`Must run suid root for multiuser support`** The screen binary does not have the required permissions. On Ubuntu and Debian, reinstall the package to restore them: `sudo apt reinstall screen`. **Cannot reattach to a session created by another user** Screen sessions are user-specific. You must be logged in as the same user who created the session. To share a session across users, enable multiuser mode inside Screen with `Ctrl+a` `:multiuser on` and then grant access with `Ctrl+a` `:acladd username`. ## FAQ **What is the difference between Screen and tmux?** Both are terminal multiplexers that keep sessions alive after disconnecting. tmux has a more active development cycle, cleaner configuration, and better pane management. Screen is more widely pre-installed. For new setups, tmux is generally the better choice. **How do I scroll up in Screen?** Press `Ctrl+a` `[` to enter scrollback mode, then use the arrow keys or `Page Up` / `Page Down` to navigate. Press `q` or `Escape` to exit. **How do I share a Screen session between two users?** From inside the session, run `Ctrl+a` `:multiuser on` and then `Ctrl+a` `:acladd username`. The other user can then attach with `screen -x session_id`. **How do I log a Screen session to a file?** Press `Ctrl+a` `H` to toggle logging. Screen writes output to a file named `screenlog.N` in your home directory, where `N` is the window number. ## Conclusion GNU Screen lets you keep terminal sessions alive across disconnections, run multiple windows in a single session, and resume work exactly where you left off. Use `screen -S name` to create named sessions, `Ctrl+a` `d` to detach, and `screen -r` to reattach from any terminal. If you have any questions, feel free to leave a comment below. Tags Linuxize Weekly Newsletter A quick weekly roundup of new tutorials, news, and tips. About the authors ![Dejan Panovski](https://linuxize.com/images/authors/dejan-panovski.jpg) Dejan Panovski Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides. [View author page](https://linuxize.com/authors/dejan-panovski/)
Shard72 (laksa)
Root Hash253233583582590872
Unparsed URLcom,linuxize!/post/how-to-use-linux-screen/ s443