âšď¸ 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/kill-screen-session-linux/ |
| Last Crawled | 2026-04-14 14:25:34 (2 days ago) |
| First Indexed | 2023-04-13 22:35:33 (3 years ago) |
| HTTP Status Code | 200 |
| Meta Title | How to Kill a Screen Session in Linux? - Linux Genie |
| Meta Description | To kill a screen session in Linux, the users can exercise the screen, kill, and pkill commands. Read this post for more details. |
| Meta Canonical | null |
| Boilerpipe Text | In Linux, a screen session is a way to run multiple terminal sessions within a single shell window. It allows you to detach from a terminal session and then re-attach it later.
It is important to kill a terminal session, including a screen session, because it frees up system resources and prevents processes from running indefinitely. If a process is left running in the background of a terminal session, it can consume system resources even after you close the terminal window. In some cases, this can cause system instability or even crashes.
Considering the importance of killing a screen session, this post will demonstrate numerous methods to kill a screen session on Linux.
Note:
The commands to kill a screen session are the same across all the Linux distributions. As a reference, we will perform the practical demonstration of these commands on
Ubuntu 22.04
.
Method 1: Using the screen Command
The simplest method for killing a screen session is by using the screen command. To do this, you first need to list all active screen sessions using the following command:
$ screen -ls
This will display a list of all active screen sessions, their process IDs (PIDs), and other information.
Syntax
To kill a specific screen session, you need to put the session ID by following the below-mentioned command:
$ screen -X -S [session ID] quit
Replace [session ID] with the ID of the screen session you want to kill.
Example
As in our case, the session Id is 18313, so the command would be:
$ screen -X -S 18313 quit
When the command is executed, it will show the interface as below:
The screen session has been terminated.
Note:
Whenever you are about to terminate a screen session, you will automatically be navigated to the screen command.
Verification
Now, letâs verify whether the session has been terminated or not. Again, use the âscreen lsâ command as follows:
$ screen -ls
The commandâs output shows there is no screen session currently onboard.
Method 2: Using the kill command
Another method for killing a screen session is by using the kill command. This method is useful to kill a screen session and all of its child processes.
Step 1: Get the Process ID of the Screen Session
To do this, first, you need to find the PID of the screen session using the following command:
$ ps -ef | grep SCREEN
This will display a list of all processes with âSCREENâ in the name. Look for the process with the name of your screen session, and note its PID.
Step 2: Kill the Screen Session Using its Process ID
Once you have the PID, you can use the kill command to terminate the session and all its child processes. The command provided below will kill the screen session having process id 18460:
$ kill 18460
The specific screen session(s) has been terminated.
Verification
For verification, you can use the âscreen -lsâ command to ensure the screen session has been terminated.
Method 3: Using the pkill Command
The pkill command is a more powerful version of the kill command that allows you to kill processes by name. This method is useful if you need to know the PID of the screen session. However, it is necessary to keep the sessionâs name in mind.
Example
The pkill command can be used with the process name to kill all the instances. For instance, the command below will kill all the sessions with a screen in their name.
$ pkill screen
This will kill all processes with âscreenâ in their name, including all screen sessions.
Verification
For more satisfaction, use the âscreen -lsâ command to ensure that the session has been terminated.
Wrap Up
A screen session is a powerful feature in Linux that allows running multiple terminal sessions within a single shell window. However, knowing how to kill a screen session is essential to free up system resources and prevent processes from running indefinitely.
This post demonstrated three different methods to kill a screen session on Linux: using the screen command, the kill command, and the pkill command. By knowing these methods, you can efficiently manage and control your terminal sessions and ensure the optimal performance of your system.
Keep visiting
Linux-Genie
for more tips and tricks. |
| 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. How to Kill a Screen Session in Linux?
# How to Kill a Screen Session in Linux?
***
By
[Adnan Shabbir](https://linuxgenie.net/author/ashabbir "Posts by Adnan Shabbir")
.
Published on
12/04/2023
.
12/04/2023
In Linux, a screen session is a way to run multiple terminal sessions within a single shell window. It allows you to detach from a terminal session and then re-attach it later.
It is important to kill a terminal session, including a screen session, because it frees up system resources and prevents processes from running indefinitely. If a process is left running in the background of a terminal session, it can consume system resources even after you close the terminal window. In some cases, this can cause system instability or even crashes.
Considering the importance of killing a screen session, this post will demonstrate numerous methods to kill a screen session on Linux.
**Note:** The commands to kill a screen session are the same across all the Linux distributions. As a reference, we will perform the practical demonstration of these commands on **Ubuntu 22.04**.
## Method 1: Using the screen Command
The simplest method for killing a screen session is by using the screen command. To do this, you first need to list all active screen sessions using the following command:
```
$ screen -ls
```

This will display a list of all active screen sessions, their process IDs (PIDs), and other information.
### Syntax
To kill a specific screen session, you need to put the session ID by following the below-mentioned command:
```
$ screen -X -S [session ID] quit
```
Replace \[session ID\] with the ID of the screen session you want to kill.
### Example
As in our case, the session Id is 18313, so the command would be:
```
$ screen -X -S 18313 quit
```
When the command is executed, it will show the interface as below:

The screen session has been terminated.
**Note:** Whenever you are about to terminate a screen session, you will automatically be navigated to the screen command.
### Verification
Now, letâs verify whether the session has been terminated or not. Again, use the âscreen lsâ command as follows:
```
$ screen -ls
```

The commandâs output shows there is no screen session currently onboard.
## Method 2: Using the kill command
Another method for killing a screen session is by using the kill command. This method is useful to kill a screen session and all of its child processes.
### Step 1: Get the Process ID of the Screen Session
To do this, first, you need to find the PID of the screen session using the following command:
```
$ ps -ef | grep SCREEN
```

This will display a list of all processes with âSCREENâ in the name. Look for the process with the name of your screen session, and note its PID.
### Step 2: Kill the Screen Session Using its Process ID
Once you have the PID, you can use the kill command to terminate the session and all its child processes. The command provided below will kill the screen session having process id 18460:
```
$ kill 18460
```

The specific screen session(s) has been terminated.
### Verification
For verification, you can use the âscreen -lsâ command to ensure the screen session has been terminated.
## Method 3: Using the pkill Command
The pkill command is a more powerful version of the kill command that allows you to kill processes by name. This method is useful if you need to know the PID of the screen session. However, it is necessary to keep the sessionâs name in mind.
### Example
The pkill command can be used with the process name to kill all the instances. For instance, the command below will kill all the sessions with a screen in their name.
\$ pkill screen

This will kill all processes with âscreenâ in their name, including all screen sessions.
### Verification
For more satisfaction, use the âscreen -lsâ command to ensure that the session has been terminated.
## Wrap Up
A screen session is a powerful feature in Linux that allows running multiple terminal sessions within a single shell window. However, knowing how to kill a screen session is essential to free up system resources and prevent processes from running indefinitely.
This post demonstrated three different methods to kill a screen session on Linux: using the screen command, the kill command, and the pkill command. By knowing these methods, you can efficiently manage and control your terminal sessions and ensure the optimal performance of your system.
Keep visiting [Linux-Genie](https://linuxgenie.net/) for more tips and tricks.
[](https://linuxgenie.net/kill-screen-session-linux/ "Printer Friendly, PDF & Email")
[â Previous Post](https://linuxgenie.net/clear-terminal-screen-ubuntu/)
## [How to Clear the Terminal Screen in Ubuntu?](https://linuxgenie.net/clear-terminal-screen-ubuntu/)
[Next Post â](https://linuxgenie.net/the-mind-blowing-5-js-tricks-you-never-knew-existed/)
## [The Mind-Blowing 5 JS Tricks You Never Knew Existed](https://linuxgenie.net/the-mind-blowing-5-js-tricks-you-never-knew-existed/)
Categories [how-tos](https://linuxgenie.net/category/how-tos/ "View all posts in how-tos")
Tags [kill](https://linuxgenie.net/tag/kill/ "View all posts tagged kill")[Linux](https://linuxgenie.net/tag/linux/ "View all posts tagged Linux")[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 | In Linux, a screen session is a way to run multiple terminal sessions within a single shell window. It allows you to detach from a terminal session and then re-attach it later.
It is important to kill a terminal session, including a screen session, because it frees up system resources and prevents processes from running indefinitely. If a process is left running in the background of a terminal session, it can consume system resources even after you close the terminal window. In some cases, this can cause system instability or even crashes.
Considering the importance of killing a screen session, this post will demonstrate numerous methods to kill a screen session on Linux.
**Note:** The commands to kill a screen session are the same across all the Linux distributions. As a reference, we will perform the practical demonstration of these commands on **Ubuntu 22.04**.
## Method 1: Using the screen Command
The simplest method for killing a screen session is by using the screen command. To do this, you first need to list all active screen sessions using the following command:
```
$ screen -ls
```

This will display a list of all active screen sessions, their process IDs (PIDs), and other information.
### Syntax
To kill a specific screen session, you need to put the session ID by following the below-mentioned command:
```
$ screen -X -S [session ID] quit
```
Replace \[session ID\] with the ID of the screen session you want to kill.
### Example
As in our case, the session Id is 18313, so the command would be:
```
$ screen -X -S 18313 quit
```
When the command is executed, it will show the interface as below:

The screen session has been terminated.
**Note:** Whenever you are about to terminate a screen session, you will automatically be navigated to the screen command.
### Verification
Now, letâs verify whether the session has been terminated or not. Again, use the âscreen lsâ command as follows:
```
$ screen -ls
```

The commandâs output shows there is no screen session currently onboard.
## Method 2: Using the kill command
Another method for killing a screen session is by using the kill command. This method is useful to kill a screen session and all of its child processes.
### Step 1: Get the Process ID of the Screen Session
To do this, first, you need to find the PID of the screen session using the following command:
```
$ ps -ef | grep SCREEN
```

This will display a list of all processes with âSCREENâ in the name. Look for the process with the name of your screen session, and note its PID.
### Step 2: Kill the Screen Session Using its Process ID
Once you have the PID, you can use the kill command to terminate the session and all its child processes. The command provided below will kill the screen session having process id 18460:
```
$ kill 18460
```

The specific screen session(s) has been terminated.
### Verification
For verification, you can use the âscreen -lsâ command to ensure the screen session has been terminated.
## Method 3: Using the pkill Command
The pkill command is a more powerful version of the kill command that allows you to kill processes by name. This method is useful if you need to know the PID of the screen session. However, it is necessary to keep the sessionâs name in mind.
### Example
The pkill command can be used with the process name to kill all the instances. For instance, the command below will kill all the sessions with a screen in their name.
\$ pkill screen

This will kill all processes with âscreenâ in their name, including all screen sessions.
### Verification
For more satisfaction, use the âscreen -lsâ command to ensure that the session has been terminated.
## Wrap Up
A screen session is a powerful feature in Linux that allows running multiple terminal sessions within a single shell window. However, knowing how to kill a screen session is essential to free up system resources and prevent processes from running indefinitely.
This post demonstrated three different methods to kill a screen session on Linux: using the screen command, the kill command, and the pkill command. By knowing these methods, you can efficiently manage and control your terminal sessions and ensure the optimal performance of your system.
Keep visiting [Linux-Genie](https://linuxgenie.net/) for more tips and tricks.
[](https://linuxgenie.net/kill-screen-session-linux/ "Printer Friendly, PDF & Email") |
| Shard | 53 (laksa) |
| Root Hash | 1169155973887509853 |
| Unparsed URL | net,linuxgenie!/kill-screen-session-linux/ s443 |