âšď¸ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.1 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://linuxgenie.net/detach-screen-session-from-terminal/ |
| Last Crawled | 2026-04-07 20:41:46 (1 day ago) |
| First Indexed | 2023-05-31 13:37:19 (2 years ago) |
| HTTP Status Code | 200 |
| Meta Title | How Do I Detach a Screen Session From a Terminal? - Linux Genie |
| Meta Description | To detach a screen session from terminal, use the "screen -d " and the shortcut key "CTRL+A+D" command. Read the post for more details. |
| Meta Canonical | null |
| Boilerpipe Text | A screen session in
Linux
refers to a virtual terminal that allows users to run multiple terminal sessions within a single window. It allows creating, managing, and switching between multiple screens, each running its processes or applications. Screen sessions are particularly useful for remote or long-running processes as they continue running even after the user disconnects, ensuring uninterrupted execution.
Detaching a screen session means disconnecting from it while leaving it running in the background. This feature is crucial in Linux terminal usage. It allows users to start a process, detach from the session, and later reattach it from any location, ensuring process continuity and convenience.
This post will address the possible methods to detach a screen session in linux from the terminal. The commands will be practiced on
Ubuntu 22.04
.
Prerequisites: Install screen Command
Before moving further, you must ensure the screen command is installed on your Linux system. If not, use the commands below to install it on the respective Linux distribution:
$ sudo apt install screen  #Debian/Ubuntu-Based
$ sudo yum install screen #CentOS/RHEL-Based
$ sudo dnf install screen  #Fedora-Based
$ sudo pacman -S screen  #Arch-Based
Method 1: Detach a Screen Session Using the screen Command
The screen command in Linux can be used to create and manage terminal sessions. The screen command lets you detach from a screen session, allowing it to continue running in the background.
The syntax of the screen command to detach a screen session is as follows:
$ screen -d <session-id>
If you look at the syntax, the session id is required to detach the screen session. Letâs practice it through an example:
Step 1: List the screen Sessions
First, list the possible screen session attached right now:
$ screen -ls
Step 2: Terminate the Session
Use the session id of the screen session in the screen command to detach that session from a terminal. In our case, the session id is 3302, as shown in the previous step:
$ screen -d 3302
The output shows the session has been detached, and the original terminal will be back. Further, you can verify whether the session has been detached using the â
screen -ls
â command.
Note
: If you want to reattach the session, use the command â
screen -r <session-id>.
â
Method 2: Detach a Screen Session Using the Keyboard Shortcut
Interestingly, the keyboard shortcut is another way to detach the screen session. First, you must open the terminal to which the screen session is attached. Then, use the shortcut key â
CTRL+A+D
â to detach that session. Letâs do it practically. This shortcut will terminate the first encountered screen session.
We have opened up a terminal where the screen session is attached. Upon using the shortcut key â
CTRL+A+D
,â the screen session detaches instantly with the following prompt on the terminal screen:
The output shows that the session having the
id=3411
has been detached. To verify it, you can use the following command:
$ screen -ls
Wrap Up
The screen sessions allow you to run multiple processes/applications on various sessions. This process is carried out using the screen command. When there are multiple sessions, and you want to detach a few from the terminal, you can use the screen command and the shortcut key âCTRL+A+D.â
The screen command only terminates the session whose session ID is provided, whereas the shortcut key detaches the first encountered screen session. Further, users can use the âscree -r <session-id>â command if they want to reattach any session.
You have learned the possible methods and their steps to detach a screen session from a terminal. For more tips and tricks on Linux, keep visiting
Linux Genie
and subscribe to the newsletter for the latest posts. |
| Markdown | ***
Begin typing your search above and press return to search. Press Esc to cancel.
# [Linux Genie](https://linuxgenie.net/)
## Primary Navigation
- [how-tos](https://linuxgenie.net/category/how-tos/)
- [Commands](https://linuxgenie.net/category/commands/)
- [Scripting](https://linuxgenie.net/category/scripting/)
- [Master Linux In 20 Minutes](http://freepdf.linuxgenie.net/)

1. [Home](https://linuxgenie.net/)
2. [how-tos](https://linuxgenie.net/category/how-tos/ "View all posts filed under how-tos")
3. [linux](https://linuxgenie.net/category/linux/ "View all posts filed under linux")
4. How Do I Detach a Screen Session From a Terminal?
# How Do I Detach a Screen Session From a Terminal?
***
By
[Adnan Shabbir](https://linuxgenie.net/author/ashabbir "Posts by Adnan Shabbir")
.
Published on
30/05/2023
.
11/06/2023
A screen session in [Linux](https://linuxgenie.net/top-6-free-and-open-source-distributions-for-linux/) refers to a virtual terminal that allows users to run multiple terminal sessions within a single window. It allows creating, managing, and switching between multiple screens, each running its processes or applications. Screen sessions are particularly useful for remote or long-running processes as they continue running even after the user disconnects, ensuring uninterrupted execution.
Detaching a screen session means disconnecting from it while leaving it running in the background. This feature is crucial in Linux terminal usage. It allows users to start a process, detach from the session, and later reattach it from any location, ensuring process continuity and convenience.
This post will address the possible methods to detach a screen session in linux from the terminal. The commands will be practiced on [**Ubuntu 22.04**.](https://linuxgenie.net/how-to-download-and-install-ubuntu-22-04/)
## Prerequisites: Install screen Command
Before moving further, you must ensure the screen command is installed on your Linux system. If not, use the commands below to install it on the respective Linux distribution:
```
$ sudo apt install screen  #Debian/Ubuntu-Based
$ sudo yum install screen #CentOS/RHEL-Based
$ sudo dnf install screen  #Fedora-Based
$ sudo pacman -S screen  #Arch-Based
```
## Method 1: Detach a Screen Session Using the screen Command
The screen command in Linux can be used to create and manage terminal sessions. The screen command lets you detach from a screen session, allowing it to continue running in the background.
The syntax of the screen command to detach a screen session is as follows:
```
$ screen -d <session-id>
```
If you look at the syntax, the session id is required to detach the screen session. Letâs practice it through an example:
### Step 1: List the screen Sessions
First, list the possible screen session attached right now:
```
$ screen -ls
```

### Step 2: Terminate the Session
Use the session id of the screen session in the screen command to detach that session from a terminal. In our case, the session id is 3302, as shown in the previous step:
```
$ screen -d 3302
```

The output shows the session has been detached, and the original terminal will be back. Further, you can verify whether the session has been detached using the â**screen -ls**â command.
**Note**: If you want to reattach the session, use the command â**screen -r \<session-id\>.**â
## Method 2: Detach a Screen Session Using the Keyboard Shortcut
Interestingly, the keyboard shortcut is another way to detach the screen session. First, you must open the terminal to which the screen session is attached. Then, use the shortcut key â**CTRL+A+D**â to detach that session. Letâs do it practically. This shortcut will terminate the first encountered screen session.
We have opened up a terminal where the screen session is attached. Upon using the shortcut key â**CTRL+A+D**,â the screen session detaches instantly with the following prompt on the terminal screen:

The output shows that the session having the **id=3411** has been detached. To verify it, you can use the following command:
```
$ screen -ls
```

## Wrap Up
The screen sessions allow you to run multiple processes/applications on various sessions. This process is carried out using the screen command. When there are multiple sessions, and you want to detach a few from the terminal, you can use the screen command and the shortcut key âCTRL+A+D.â
The screen command only terminates the session whose session ID is provided, whereas the shortcut key detaches the first encountered screen session. Further, users can use the âscree -r \<session-id\>â command if they want to reattach any session.
You have learned the possible methods and their steps to detach a screen session from a terminal. For more tips and tricks on Linux, keep visiting [Linux Genie](https://linuxgenie.net/) and subscribe to the newsletter for the latest posts.
[](https://linuxgenie.net/detach-screen-session-from-terminal/ "Printer Friendly, PDF & Email")
[â Previous Post](https://linuxgenie.net/diff-output-two-commands/)
## [How Do I Diff the Output of Two Commands?](https://linuxgenie.net/diff-output-two-commands/)
[Next Post â](https://linuxgenie.net/how-to-use-the-du-command-to-show-disk-usage-one-level-only/)
## [How to Use the du Command to Show Disk Usage One Level Only](https://linuxgenie.net/how-to-use-the-du-command-to-show-disk-usage-one-level-only/)
Categories [how-tos](https://linuxgenie.net/category/how-tos/ "View all posts in how-tos")[linux](https://linuxgenie.net/category/linux/ "View all posts in linux")
Tags [detach](https://linuxgenie.net/tag/detach/ "View all posts tagged detach")[screen](https://linuxgenie.net/tag/screen/ "View all posts tagged screen")[screen session](https://linuxgenie.net/tag/screen-session/ "View all posts tagged screen session")
***


### Author
#### [Adnan Shabbir](https://linuxgenie.net/author/ashabbir/ "Posts by Adnan Shabbir")
Adnan, a Software Engineer with an aim to learn and teach the community through words. The go-to expert for all things about Linux, Command Prompt, and Shell. He has honed his skills in crafting easy-to-understand documentation, tutorials, and articles on these powerful tools.
### Recent Posts
- [Wayland vs X11 Performance Comparison](https://linuxgenie.net/wayland-vs-x11-performance-comparison/)
- [How to Use systemd-analyze to Diagnose Boot Issues](https://linuxgenie.net/systemd-analyze-to-diagnose-boot-issues/)
- [How to Speed Up Your Linux Boot Time](https://linuxgenie.net/speed-up-linux-boot-time/)
- [Debian vs Arch: Which is Better for Advanced Linux Users?](https://linuxgenie.net/debian-vs-arch-which-better-for-linux-users/)
- [Bash Globbing Explained With Real-Life Use Cases](https://linuxgenie.net/bash-globbing-explained/)
### Categories
- [AlmaLinux](https://linuxgenie.net/category/almalinux/)
- [Arch](https://linuxgenie.net/category/arch/)
- [CentOS](https://linuxgenie.net/category/centos/)
- [Commands](https://linuxgenie.net/category/commands/)
- [Debian](https://linuxgenie.net/category/debian/)
- [how-tos](https://linuxgenie.net/category/how-tos/)
- [linux](https://linuxgenie.net/category/linux/)
- [Manjaro](https://linuxgenie.net/category/manjaro/)
- [Mint](https://linuxgenie.net/category/mint/)
- [openSUSE](https://linuxgenie.net/category/opensuse/)
- [Red Hat](https://linuxgenie.net/category/red-hat/)
- [Scripting](https://linuxgenie.net/category/scripting/)
- [Ubuntu](https://linuxgenie.net/category/ubuntu/)
### Tags
[Bash](https://linuxgenie.net/tag/bash/) [Bash scripting](https://linuxgenie.net/tag/bash-scripting/) [Cat Command](https://linuxgenie.net/tag/cat-command/) [CentOS](https://linuxgenie.net/tag/centos/) [command not found](https://linuxgenie.net/tag/command-not-found/) [Data](https://linuxgenie.net/tag/data/) [Debian](https://linuxgenie.net/tag/debian/) [Debian 11](https://linuxgenie.net/tag/debian-11/) [Debian 12](https://linuxgenie.net/tag/debian-12/) [Directories](https://linuxgenie.net/tag/directories/) [Directory](https://linuxgenie.net/tag/directory/) [Docker](https://linuxgenie.net/tag/docker/) [File](https://linuxgenie.net/tag/file/) [Files](https://linuxgenie.net/tag/files/) [Firewall](https://linuxgenie.net/tag/firewall/) [Google Chrome](https://linuxgenie.net/tag/google-chrome/) [install](https://linuxgenie.net/tag/install/) [IP Address](https://linuxgenie.net/tag/ip-address/) [Java](https://linuxgenie.net/tag/java/) [JavaScript](https://linuxgenie.net/tag/javascript/) [Linux](https://linuxgenie.net/tag/linux/) [Linux Mint](https://linuxgenie.net/tag/linux-mint/) [Linux Mint 20.3](https://linuxgenie.net/tag/linux-mint-20-3/) [Linux Mint 21](https://linuxgenie.net/tag/linux-mint-21/) [Linux Mint 21.2](https://linuxgenie.net/tag/linux-mint-21-2/) [Linux Mint LMDE](https://linuxgenie.net/tag/linux-mint-lmde/) [linux troubleshooting](https://linuxgenie.net/tag/linux-troubleshooting/) [Manjaro Linux 21](https://linuxgenie.net/tag/manjaro-linux-21/) [MariaDB](https://linuxgenie.net/tag/mariadb/) [MongoDB](https://linuxgenie.net/tag/mongodb/) [mysql](https://linuxgenie.net/tag/mysql/) [Nginx](https://linuxgenie.net/tag/nginx/) [Python](https://linuxgenie.net/tag/python/) [Scripting](https://linuxgenie.net/tag/scripting/) [ssh](https://linuxgenie.net/tag/ssh/) [string](https://linuxgenie.net/tag/string/) [TeamViewer](https://linuxgenie.net/tag/teamviewer/) [Terminal](https://linuxgenie.net/tag/terminal/) [Ubuntu](https://linuxgenie.net/tag/ubuntu/) [Ubuntu 22.04](https://linuxgenie.net/tag/ubuntu-22-04/) [Users](https://linuxgenie.net/tag/users/) [variable](https://linuxgenie.net/tag/variable/) [Virtualbox](https://linuxgenie.net/tag/virtualbox/) [VMware Workstation](https://linuxgenie.net/tag/vmware-workstation/) [Zoom](https://linuxgenie.net/tag/zoom/)
##
- [Home](https://linuxgenie.net/)
- [Privacy Policy](https://linuxgenie.net/privacy-policy/)
- [Contact Us](https://linuxgenie.net/contact/)
2026 Š Managed & Operated by [LinuxHint.com](https://linuxhint.com/) |
| Readable Markdown | A screen session in [Linux](https://linuxgenie.net/top-6-free-and-open-source-distributions-for-linux/) refers to a virtual terminal that allows users to run multiple terminal sessions within a single window. It allows creating, managing, and switching between multiple screens, each running its processes or applications. Screen sessions are particularly useful for remote or long-running processes as they continue running even after the user disconnects, ensuring uninterrupted execution.
Detaching a screen session means disconnecting from it while leaving it running in the background. This feature is crucial in Linux terminal usage. It allows users to start a process, detach from the session, and later reattach it from any location, ensuring process continuity and convenience.
This post will address the possible methods to detach a screen session in linux from the terminal. The commands will be practiced on [**Ubuntu 22.04**.](https://linuxgenie.net/how-to-download-and-install-ubuntu-22-04/)
## Prerequisites: Install screen Command
Before moving further, you must ensure the screen command is installed on your Linux system. If not, use the commands below to install it on the respective Linux distribution:
```
$ sudo apt install screen  #Debian/Ubuntu-Based
$ sudo yum install screen #CentOS/RHEL-Based
$ sudo dnf install screen  #Fedora-Based
$ sudo pacman -S screen  #Arch-Based
```
## Method 1: Detach a Screen Session Using the screen Command
The screen command in Linux can be used to create and manage terminal sessions. The screen command lets you detach from a screen session, allowing it to continue running in the background.
The syntax of the screen command to detach a screen session is as follows:
```
$ screen -d <session-id>
```
If you look at the syntax, the session id is required to detach the screen session. Letâs practice it through an example:
### Step 1: List the screen Sessions
First, list the possible screen session attached right now:
```
$ screen -ls
```

### Step 2: Terminate the Session
Use the session id of the screen session in the screen command to detach that session from a terminal. In our case, the session id is 3302, as shown in the previous step:
```
$ screen -d 3302
```

The output shows the session has been detached, and the original terminal will be back. Further, you can verify whether the session has been detached using the â**screen -ls**â command.
**Note**: If you want to reattach the session, use the command â**screen -r \<session-id\>.**â
## Method 2: Detach a Screen Session Using the Keyboard Shortcut
Interestingly, the keyboard shortcut is another way to detach the screen session. First, you must open the terminal to which the screen session is attached. Then, use the shortcut key â**CTRL+A+D**â to detach that session. Letâs do it practically. This shortcut will terminate the first encountered screen session.
We have opened up a terminal where the screen session is attached. Upon using the shortcut key â**CTRL+A+D**,â the screen session detaches instantly with the following prompt on the terminal screen:

The output shows that the session having the **id=3411** has been detached. To verify it, you can use the following command:
```
$ screen -ls
```

## Wrap Up
The screen sessions allow you to run multiple processes/applications on various sessions. This process is carried out using the screen command. When there are multiple sessions, and you want to detach a few from the terminal, you can use the screen command and the shortcut key âCTRL+A+D.â
The screen command only terminates the session whose session ID is provided, whereas the shortcut key detaches the first encountered screen session. Further, users can use the âscree -r \<session-id\>â command if they want to reattach any session.
You have learned the possible methods and their steps to detach a screen session from a terminal. For more tips and tricks on Linux, keep visiting [Linux Genie](https://linuxgenie.net/) and subscribe to the newsletter for the latest posts.
[](https://linuxgenie.net/detach-screen-session-from-terminal/ "Printer Friendly, PDF & Email") |
| Shard | 53 (laksa) |
| Root Hash | 1169155973887509853 |
| Unparsed URL | net,linuxgenie!/detach-screen-session-from-terminal/ s443 |