βΉοΈ 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://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/ |
| Last Crawled | 2026-04-03 09:38:23 (3 days ago) |
| First Indexed | 2024-06-26 16:40:03 (1 year ago) |
| HTTP Status Code | 200 |
| Meta Title | How to Use the Linux Screen Command | Liquid Web |
| Meta Description | Get the most out of the Linux screen command. Manage multiple terminal sessions with ease, including remote access. Learn key bindings and more. |
| Meta Canonical | null |
| Boilerpipe Text | What is Screen?
Screen is a terminal program in Linux which allows us to use a virtual (VT100 terminal) as full-screen window manager which multiplexes an open physical terminal between multiple processes, which are typically, interactive shells. It allows us to access multiple terminal sessions within a single terminal or a remote terminal session. It is most useful when addressing multiple Linux shell commands on the command line, as well as separating commands from the shell that started the commands.
Screen also allows a user to initiate a command from one terminal, disconnect from that terminal, and then reconnect from a different location to that same terminal, while using a different terminal without having to restart the command. This simply lets a user better control multiple and separate command windows.Β
Screen also lets multiple remote computers connect to the same screen session at once. This allows multiple users to connect to the same screen session allowing a second user to follow along with another administrator working on a server.
Basic Commands
Screen is started by using the following screen command:
screen
Screen Flags
Here is a list of some of the more common flags and how we can use them.
Flag
D
escription
E
xample
-ls
Lists the current screen sessions
screen -ls
-aS
Create and names a screen session which include all capabilities
screen -aS screenname
-r
Resume a detached screen session
screen -r (name|pid)
-x
Attach to an attached screen session
screen -x (name|pid)
-d
Detach an attached screen session
screen -d (name|pid)
-d
-m
Start an new screen session in detached mode and run $command
screen -d -m $command
-DR
Force disconnect of current user and reconnect with your user
screen -DR
-wipe
Removes all dead screen sessions. (Sessions that are unreachable)
screen -wipe
Default Session Key Bindings
While inside the screen session,
ctrl+a
activates the key bindings. The following table shows some of the default key bindings:
key
binding
?
Show key bindings.
A
Set a title for the current window.
c
Create a new window.
n
Switch to the next window.
p
Switch to the previous window.
0-9
Switch to window number n.
w
Show a list of windows.
β
Present a list of windows for selection.
F
Resize the window to the current region size.
[ or esc
Enter copy/scrollback mode.
k
Destroy current window.
Screen Examples
To get a full list of available screens, use this command:
screen -ls
we will then see output similar to this:
There is a screen on:
26092.ttyp0.host
(Attached) 1 Socket in /tmp/screens/S-root.
This output typically shows us the currently running screens. As you can see by the β
(Attached)
β output, the 26092 session is currently attached to a terminal. Since this screen is currently attached, we can detach it remotely using this command.
screen -d 26092
If another user is logged onto this screen session and actively working, this modification will kill their session. So, beware of detaching screen sessions this way. To reattach to that same screen, run this command.
screen -r 26092
We can detach and reattach to the screen concurrently using this command.
screen -d -r 26092
In order to create a new screen session called LW, we can enter this command.
screen -S LW
Modifying Screens Behavior
Scrollback
To enable scrollback in xterm, we can add the following information to our
~/.screenrc
file on our workstation.
# Enable mouse scrolling and scroll bar history scrolling
termcapinfo xterm* ti@:te@
Logging
If we use the
-L
option with screen, it tells screen to turn on the automatic logging output for the window. This will create a file within the current directory, with the nameΒ
screenlog.#
Β where
#
Β is the ID number for that screen beginning from 0.
screen -L -S LW
Multiuser Screen Sessions
Multiuser is an excellent option to use if we need to share our session with others. It is not turned on by default for security reasons but can be enabled easily. In order to allow multiple users to connect to the same screen session, the
multiuser
option must be enabled. Here are the steps needed to complete this task.
Begin by logging in to the server and starting the screen session via the command line.Β
Next, type
Ctrl-a
to enter the command mode.
Now, type in β:β (colon) to enter the screenβs built-in command line.
We can now activate the multiuser mode by entering
multiuser on
in the screenβs command line, which appears in a reverse color at the bottom of the console window.Β
To confirm this change, hit Enter or Return.Β
Multiuser mode can be very useful if we are attempting to demonstrate to someone what we are doing on a server. With this mode on, the other user will be able to follow our keystrokes within that screen session.
Further Exploration
If more in depth information is required, we can always consult the man page for screen using:
man screen
Screen Tricks
To initiate a screen session named
LW
and run the top command in it without attaching to it, nothing will appear to happen but you will see the screen with
screen -ls
:
screen -S LW -d -m top
To end or kill the LW screen session, use this command:
screen -S LW -p 0 -X kill
To start a bash session in screen, we can use this command:
screen -S LW -d -m /bin/bash
To run the ls command inside the screen session use this command:
screen -S LW -p 0 -X exec ls /home
To end or kill the LW screen session, run this command:
screen -S LW -p 0 -X kill
To scroll up within a screen window, use this command:
CTRL+a then ESC, #Press CTRL KEY and 'A' KEY together and then hit the ESC KEY #to scroll using the arrow keys hit ESC again to exit.
Most Useful Screen Commands
Here is a quick overview of the most useful screen commands that we might need to use.
We should enter these key commands in lower case, but they are shown here in uppercase to make the command more readable.
Ctrl+A, C β This key command creates a new screen
Ctrl+A, N (where N is equal to the number of the screen) β This key command switch us to a specific screen
Ctrl+A, A β This key command switches us to the next screen
Ctrl+A, W β This key command lets us view a list of screens
Ctrl+A, β (double quote) β This key command allows us to view the screen picker
Ctrl+A, Ctrl+D β This key command detaches us from the current session
screen -R β This key command attaches us to a running screen session
Ctrl+A, ? β This key command shows us the shortcut key options
There are numerous other commands that we can use to control our screen session, many of which can be viewed by typing β
Ctrl+A ?
β at the prompt. This will bring up a help window that shows us all the available key bindings. For example:
The β
C-a p
β and β
C-a n
β key sequence can be used to switch to the next or previous window.
Using the β
C-a N
β key sequence β (where N is a number from 0 to 9, that can will connect to the corresponding screen window.
The β
C-a w
β key sequence displays a list of all screen windows. The unique ID of each window, along with its name, and running process is displayed, for each individual window. The current window will be marked with an asterisk (*).
The β
C-a k
βkey sequence will kill the current window session. We can also type βexitβ to kill the current window. If no other screen sessions are open, screen will simply exits. The β
C-a \
β key sequence also accomplishes the same task.
The β
C-a d
β key sequence detaches the from the current screen session.Β
We can also detach from the screen by closing the terminal that is running our screen utility. Although this may appear to close our terminal session, in reality this simply closes the terminal and unbinds our session from the current terminal. All the commands that were started under our screen will continue to run.
We can also log out from the server and login again, then restart a terminal session and type β
screen -r
β to connect again from where we left off. In case, there are more than one running screen sessions on the server, screen will prompt us for a
host.tty.pid
. For example, say I have two screen sessions. So, when we type the β
screen -r
β command, it gives the following message:
$ screen -r There are several suitable screens on:
2999.pts-6.localhost (Detached)
1920.PTS-6.localhost (Detached)
To connect to one of the above detached screens
run, screen -d -r 2999.pts-6.localhost
to resume that screen.
Bottom Line
Screen is an invaluable tool when we must work with the terminal daily. It allows us to utilize a limited amount of screen space while maintaining the full functionality of a terminal window. Additionally, screen has the ability to be used as a teaching tool allowing multiple users to connect to an existing screen and, if we have enabled logging, share that file with the user for later reference.
Are you trying to use the screen command and experiencing some difficulty with the control commands, flags or other options with the program?
Our knowledgeable system administrators and experienced linux technicians are standing by to assist you with the help you need. Open a
chat
or
ticket
with us to speak with us right away! |
| Markdown | [Skip to content](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/#main)
Get high-performance hosting with expert management built in. [Explore dedicated servers](https://www.liquidweb.com/dedicated-server-hosting/managed-servers/)
- [Support](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
- Support
- [Support Overview](https://www.liquidweb.com/support/)
- [Portal Login](https://my.liquidweb.com/)
Technical Resources
- [Help Docs](https://www.liquidweb.com/help-docs/)
- [API Documentation](https://api.liquidweb.com/docs)
- [System Status](https://status.liquidweb.com/)
- [Tools](https://www.liquidweb.com/tools/)
Content Resources
- [Blog](https://www.liquidweb.com/blog/)
- [Customer Stories](https://www.liquidweb.com/case-studies/)
- [Ebooks](https://www.liquidweb.com/ebooks/)
- [White Papers](https://www.liquidweb.com/white-papers/)
- [Webinars](https://www.liquidweb.com/webinars/)
- [Contact](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
- Sales
800\.580.4985, Ext. 1
Support
Billing
[Partner programs](https://www.liquidweb.com/partner-programs/)
[Affiliate programs](https://app.impact.com/campaign-promo-signup/Liquid-Web.brand?execution=e1s1#/?viewkey=signUpPreStart)
Chat now
Weβre here 24/7 to get you the answers you need.
[All contact information](https://www.liquidweb.com/contact-us/)
[Log in](https://www.liquidweb.com/access-account/)
[Liquid Web logo](https://www.liquidweb.com/)
- [Solutions](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
- Solutions by industry
[Ecommerce](https://www.liquidweb.com/hosting-solutions/ecommerce-hosting/)
Secure, compliant infrastructure for regulated online sales
[Financial Services](https://www.liquidweb.com/hosting-solutions/financial-services-hosting/)
High-trust hosting built for security and compliance
[Agencies](https://www.liquidweb.com/hosting-solutions/hosting-for-agencies/)
Fast, flexible hosting for high-traffic client projects
[Healthcare](https://www.liquidweb.com/hipaa-hosting/)
HIPAA-ready environments for protected health data
Solutions by outcomes
[Compliance](https://www.liquidweb.com/compliance-hosting/)
Hosting aligned with HIPAA, PCI, GDPR, and audit readiness
[Launch](https://www.liquidweb.com/configuration/cloud-vps/)
Configure a high-performance server in minutes
[Commerce Scale](https://www.liquidweb.com/enterprise-hosting/ecommerce/)
Infrastructure built to handle surges, orders, and growth
[Disaster Recovery](https://www.liquidweb.com/hosting-add-ons/disaster-recovery-solutions/)
Redundant, resilient systems for rapid recovery and uptime
- [VPS Hosting](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
- [VPS Packages](https://www.liquidweb.com/vps-hosting/packages/)
[Cloud VPS Hosting](https://www.liquidweb.com/vps-hosting/cloud-vps/)
[Windows VPS Hosting](https://www.liquidweb.com/windows-vps-hosting/)
[Linux VPS Hosting](https://www.liquidweb.com/linux-vps-hosting/)
[Managed VPS](https://www.liquidweb.com/vps-hosting/managed-vps/)
[View All VPS Hosting](https://www.liquidweb.com/vps-hosting/)
- [Dedicated Servers](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
- [Bare Metal Servers](https://www.liquidweb.com/dedicated-server-hosting/bare-metal/)
[Bare Metal Packages](https://www.liquidweb.com/dedicated-server-hosting/packages/)
[Managed Dedicated](https://www.liquidweb.com/dedicated-server-hosting/managed-servers/)
[Cloud Metal Packages](https://www.liquidweb.com/cloud-hosting/packages/)
[View All Dedicated Servers](https://www.liquidweb.com/dedicated-server-hosting/)
- [Managed Hosting](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
- [Managed Hosting](https://www.liquidweb.com/managed-hosting-services/)
[Managed Servers](https://www.liquidweb.com/managed-hosting-services/servers/)
[Managed Applications](https://www.liquidweb.com/managed-hosting-services/applications/)
- [WordPress](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
- [Hosting for WordPress](https://www.liquidweb.com/wordpress-hosting/)
[Managed Hosting for WordPress](https://www.liquidweb.com/wordpress-hosting/managed-wordpress/)
[VPS for WordPress](https://www.liquidweb.com/wordpress-hosting/vps-wordpress/)
[Dedicated WordPress](https://www.liquidweb.com/wordpress-hosting/dedicated-wordpress/)
[WooCommerce Hosting](https://www.liquidweb.com/woocommerce-hosting/)
[WordPress Plugins](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
[Kadence WP](https://www.liquidweb.com/hosting-add-ons/premium-wordpress-plugins/kadence-wp/)
[The Events Calendar](https://www.liquidweb.com/hosting-add-ons/premium-wordpress-plugins/the-events-calendar/)
[Give](https://www.liquidweb.com/hosting-add-ons/premium-wordpress-plugins/give/)
[LearnDash](https://www.liquidweb.com/hosting-add-ons/premium-wordpress-plugins/learndash/)
- [GPU Hosting](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
- [GPU Hosting](https://www.liquidweb.com/gpu-hosting/)
[NVIDIA GPU Hosting](https://www.liquidweb.com/gpu-hosting/nvidia/)
[AI Training & Interface](https://www.liquidweb.com/ai-server-hosting/)
- [Products](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
- Compute
[Cloud Servers](https://www.liquidweb.com/cloud-hosting/)
Scalable, high-speed compute
[Dedicated Servers](https://www.liquidweb.com/dedicated-server-hosting/)
Reliability, power, and control
[Private Cloud](https://www.liquidweb.com/private-cloud-hosting/)
Isolated, enterprise-grade cloud
[GPU](https://www.liquidweb.com/gpu-hosting/)
Accelerated for AI & ML
[Containers](https://www.liquidweb.com/container-hosting/)
Portable workloads for any app
Platform services
[Cloud Storage](https://www.liquidweb.com/hosting-add-ons/cloud-storage-services/)
Storage for growing data needs
[Backups & DR](https://www.liquidweb.com/hosting-add-ons/disaster-recovery-solutions/)
Protection for critical workloads
[Global Private Fabric](https://www.liquidweb.com/global-private-fabric/)
Unify networks across servers
[Security & Protection](https://www.liquidweb.com/hosting-add-ons/server-protection/)
Advanced defense for data
[Load Balancing](https://www.liquidweb.com/hosting-add-ons/load-balancer-solutions/)
Optimized traffic distribution
Applications
[WordPress](https://www.liquidweb.com/wordpress-hosting/)
Optimized for fast, secure sites
[WooCommerce](https://www.liquidweb.com/woocommerce-hosting/)
Performance for scalable stores
[Magento](https://www.liquidweb.com/magento-hosting/)
Commerce-ready, built to scale
[Liquid Web logo](https://www.liquidweb.com/)
8 min read
# Guide to Using Screen Commands in Linux
[ David Singer](https://www.liquidweb.com/blog/author/dsinger/)
[Tutorials](https://www.liquidweb.com/blog/category/tutorials/)
## What is Screen?
Screen is a terminal program in Linux which allows us to use a virtual (VT100 terminal) as full-screen window manager which multiplexes an open physical terminal between multiple processes, which are typically, interactive shells. It allows us to access multiple terminal sessions within a single terminal or a remote terminal session. It is most useful when addressing multiple Linux shell commands on the command line, as well as separating commands from the shell that started the commands.
[Explore Linux VPS servers](https://www.liquidweb.com/linux-vps-hosting/)
[Build now](https://www.liquidweb.com/configuration/cloud-vps/)
Screen also allows a user to initiate a command from one terminal, disconnect from that terminal, and then reconnect from a different location to that same terminal, while using a different terminal without having to restart the command. This simply lets a user better control multiple and separate command windows.
Screen also lets multiple remote computers connect to the same screen session at once. This allows multiple users to connect to the same screen session allowing a second user to follow along with another administrator working on a server.
## Basic Commands
Screen is started by using the following screen command:
```
screen
```
### Screen Flags
Here is a list of some of the more common flags and how we can use them.
| | | |
|---|---|---|
| **Flag** | **D****escription** | **E****xample** |
| \-ls | Lists the current screen sessions | screen -ls |
| \-aS | Create and names a screen session which include all capabilities | screen -aS screenname |
| \-r | Resume a detached screen session | screen -r (name\|pid) |
| \-x | Attach to an attached screen session | screen -x (name\|pid) |
| \-d | Detach an attached screen session | screen -d (name\|pid) |
| \-d \-m | Start an new screen session in detached mode and run \$command | screen -d -m \$command |
| \-DR | Force disconnect of current user and reconnect with your user | screen -DR |
| \-wipe | Removes all dead screen sessions. (Sessions that are unreachable) | screen -wipe |
### Default Session Key Bindings
While inside the screen session, *ctrl+a* activates the key bindings. The following table shows some of the default key bindings:
| | |
|---|---|
| **key** | **binding** |
| ? | Show key bindings. |
| A | Set a title for the current window. |
| c | Create a new window. |
| n | Switch to the next window. |
| p | Switch to the previous window. |
| 0-9 | Switch to window number n. |
| w | Show a list of windows. |
| β | Present a list of windows for selection. |
| F | Resize the window to the current region size. |
| \[ or esc | Enter copy/scrollback mode. |
| k | Destroy current window. |
## Screen Examples
To get a full list of available screens, use this command:
```
screen -ls
```
we will then see output similar to this:
```
```
This output typically shows us the currently running screens. As you can see by the β*(Attached)*β output, the 26092 session is currently attached to a terminal. Since this screen is currently attached, we can detach it remotely using this command.
```
screen -d 26092
```
If another user is logged onto this screen session and actively working, this modification will kill their session. So, beware of detaching screen sessions this way. To reattach to that same screen, run this command.
```
screen -r 26092
```
We can detach and reattach to the screen concurrently using this command.
```
screen -d -r 26092
```
In order to create a new screen session called LW, we can enter this command.
```
screen -S LW
```
## Modifying Screens Behavior
### **Scrollback**
To enable scrollback in xterm, we can add the following information to our *~/.screenrc* file on our workstation.
```
```
### Logging
If we use the *\-L* option with screen, it tells screen to turn on the automatic logging output for the window. This will create a file within the current directory, with the name *screenlog.\#* where *\#* is the ID number for that screen beginning from 0.
```
screen -L -S LW
```
### **Multiuser Screen Sessions**
Multiuser is an excellent option to use if we need to share our session with others. It is not turned on by default for security reasons but can be enabled easily. In order to allow multiple users to connect to the same screen session, the **multiuser** option must be enabled. Here are the steps needed to complete this task.
1. Begin by logging in to the server and starting the screen session via the command line.
2. Next, type *Ctrl-a* to enter the command mode.
3. Now, type in β:β (colon) to enter the screenβs built-in command line.
4. We can now activate the multiuser mode by entering *multiuser on* in the screenβs command line, which appears in a reverse color at the bottom of the console window.
5. To confirm this change, hit Enter or Return.
Multiuser mode can be very useful if we are attempting to demonstrate to someone what we are doing on a server. With this mode on, the other user will be able to follow our keystrokes within that screen session.
## Further Exploration
If more in depth information is required, we can always consult the man page for screen using:
```
man screen
```
## Screen Tricks
To initiate a screen session named **LW** and run the top command in it without attaching to it, nothing will appear to happen but you will see the screen with *screen -ls*:
```
screen -S LW -d -m top
```
To end or kill the LW screen session, use this command:
```
screen -S LW -p 0 -X kill
```
To start a bash session in screen, we can use this command:
```
screen -S LW -d -m /bin/bash
```
To run the ls command inside the screen session use this command:
```
screen -S LW -p 0 -X exec ls /home
```
To end or kill the LW screen session, run this command:
```
screen -S LW -p 0 -X kill
```
To scroll up within a screen window, use this command:
```
CTRL+a then ESC, #Press CTRL KEY and 'A' KEY together and then hit the ESC KEY #to scroll using the arrow keys hit ESC again to exit.
```
## Most Useful Screen Commands
Here is a quick overview of the most useful screen commands that we might need to use.
We should enter these key commands in lower case, but they are shown here in uppercase to make the command more readable.
- Ctrl+A, C β This key command creates a new screen
- Ctrl+A, N (where N is equal to the number of the screen) β This key command switch us to a specific screen
- Ctrl+A, A β This key command switches us to the next screen
- Ctrl+A, W β This key command lets us view a list of screens
- Ctrl+A, β (double quote) β This key command allows us to view the screen picker
- Ctrl+A, Ctrl+D β This key command detaches us from the current session
- screen -R β This key command attaches us to a running screen session
- Ctrl+A, ? β This key command shows us the shortcut key options
There are numerous other commands that we can use to control our screen session, many of which can be viewed by typing β*Ctrl+A ?*β at the prompt. This will bring up a help window that shows us all the available key bindings. For example:
- The β*C-a p*β and β*C-a n*β key sequence can be used to switch to the next or previous window.
- Using the β*C-a N*β key sequence β (where N is a number from 0 to 9, that can will connect to the corresponding screen window.
- The β*C-a w*β key sequence displays a list of all screen windows. The unique ID of each window, along with its name, and running process is displayed, for each individual window. The current window will be marked with an asterisk (\*).
- The β*C-a k*βkey sequence will kill the current window session. We can also type βexitβ to kill the current window. If no other screen sessions are open, screen will simply exits. The β*C-a \\*β key sequence also accomplishes the same task.
- The β*C-a d*β key sequence detaches the from the current screen session.
We can also detach from the screen by closing the terminal that is running our screen utility. Although this may appear to close our terminal session, in reality this simply closes the terminal and unbinds our session from the current terminal. All the commands that were started under our screen will continue to run.
We can also log out from the server and login again, then restart a terminal session and type β*screen -r*β to connect again from where we left off. In case, there are more than one running screen sessions on the server, screen will prompt us for a *host.tty.pid*. For example, say I have two screen sessions. So, when we type the β*screen -r*β command, it gives the following message:
```
```
## Bottom Line
Screen is an invaluable tool when we must work with the terminal daily. It allows us to utilize a limited amount of screen space while maintaining the full functionality of a terminal window. Additionally, screen has the ability to be used as a teaching tool allowing multiple users to connect to an existing screen and, if we have enabled logging, share that file with the user for later reference.
Are you trying to use the screen command and experiencing some difficulty with the control commands, flags or other options with the program?
Our knowledgeable system administrators and experienced linux technicians are standing by to assist you with the help you need. Open a [chat](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/) or [ticket](mailto:support@liquidweb.com) with us to speak with us right away\!
[Explore VPS servers](https://www.liquidweb.com/vps-hosting/)
[Build now](https://www.liquidweb.com/configuration/cloud-vps/)
## Post navigation
[PreviousRenaming Database Tables with PhpMyAdmin](https://www.liquidweb.com/blog/renaming-database-tables-with-phpmyadmin/)
[NextWhat Is User Generated Content and How Can it Boost Your Marketing?](https://www.liquidweb.com/blog/user-generated-content/)
Get hosting news and tips straight to your inbox
Join our community today.
Table of Contents
- [What is Screen?](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/#h-what-is-screen)
- [Basic Commands](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/#h-basic-commands)
- [Screen Examples](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/#h-screen-examples)
- [Modifying Screens Behavior](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/#h-modifying-screens-behavior)
- [Further Exploration](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/#h-further-exploration)
- [Screen Tricks](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/#screen-tricks)
- [Most Useful Screen Commands](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/#most-useful-screen-commands)
- [Bottom Line](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/#bottom-line)
Essential hosting resources to help your business stay ahead

[Get the guides](https://resources.liquidweb.com/download/hosting-buying-guide-checklist)
## Related articles
[Tutorials](https://www.liquidweb.com/blog/category/tutorials/) 10 min read
[How to Install ESXi 5.x or 6.x in VMware](https://www.liquidweb.com/blog/how-to-install-esxi-in-vmware/) [Neil Golden](https://www.liquidweb.com/blog/author/ngolden/)
[Tutorials](https://www.liquidweb.com/blog/category/tutorials/) 7 min read
[Guide to Using VMware ESXi](https://www.liquidweb.com/blog/what-is-vmware-esxi/) [Michael Flores Feliz](https://www.liquidweb.com/blog/author/mflores/)
[Tutorials](https://www.liquidweb.com/blog/category/tutorials/) 8 min read
[How to Install Minikube On CentOS, Mac and Windows](https://www.liquidweb.com/blog/how-to-install-minikube/) [Beau Kent](https://www.liquidweb.com/blog/author/bkent/)
[Tutorials](https://www.liquidweb.com/blog/category/tutorials/) 2 min read
[Change PostgreSQL Authentication Method from Ident to MD5](https://www.liquidweb.com/blog/change-postgresql-authentication-method-from-ident-to-md5/) [J. Mays](https://www.liquidweb.com/blog/author/jmays/)
[Tutorials](https://www.liquidweb.com/blog/category/tutorials/) 9 min read
[How to Install Snapcraft on Ubuntu or CentOS](https://www.liquidweb.com/blog/how-to-install-snapcraft-on-ubuntu-centos/) [Justin Palmer](https://www.liquidweb.com/blog/author/jpalmer/)
[Tutorials](https://www.liquidweb.com/blog/category/tutorials/) 9 min read
[How to Install MongoDB on AlmaLinux](https://www.liquidweb.com/blog/install-mongodb-almalinux/) [Mohammed Noufal](https://www.liquidweb.com/blog/author/mnoufal/)
Related hosting content
- [Guide to Remote Desktop File Transfers](https://www.liquidweb.com/blog/remote-desktop-transfer-files/)
- [How to use kill commands in Linux](https://www.liquidweb.com/blog/linux-kill-commands/)
- [How to Display Contents of a File in Linux](https://www.liquidweb.com/blog/how-to-display-contents-of-a-file-linux/)
Dedicated Hosting
[Dedicated Servers](https://www.liquidweb.com/dedicated-server-hosting/)[Managed Dedicated](https://www.liquidweb.com/dedicated-server-hosting/managed-servers/)[Bare Metal Servers](https://www.liquidweb.com/dedicated-server-hosting/bare-metal/)[GPU Hosting](https://www.liquidweb.com/gpu-hosting/)
Cloud Services
[Bare Metal Cloud](https://www.liquidweb.com/dedicated-server-hosting/bare-metal/)[Dedicated Cloud](https://www.liquidweb.com/cloud-hosting/dedicated-cloud-server/)[Managed Cloud](https://www.liquidweb.com/cloud-hosting/managed-cloud/)[VPS Hosting](https://www.liquidweb.com/vps-hosting/)[Private](https://www.liquidweb.com/vps-hosting/) [Cloud](https://www.liquidweb.com/private-cloud-hosting/)
Managed Apps
[Managed Hosting for WordPress](https://www.liquidweb.com/wordpress-hosting/managed-wordpress/)[Managed Magento](https://www.liquidweb.com/magento-hosting/)[Managed WooCommerce](https://www.liquidweb.com/woocommerce-hosting/managed-woocommerce/)[Nexcess Platform](https://www.liquidweb.com/managed-hosting-services/applications/)
**Solutions**
[HIPAA Hosting](https://www.liquidweb.com/hipaa-hosting/)[PCI Compliant Hosting](https://www.liquidweb.com/hosting-solutions/pci-compliant-hosting/)[Ecommerce Hosting](https://www.liquidweb.com/hosting-solutions/ecommerce-hosting/)[Enterprise Hosting](https://www.liquidweb.com/enterprise-hosting/)[Finance & Fintech](https://www.liquidweb.com/hosting-solutions/financial-services-hosting/)[High Availability](https://www.liquidweb.com/hosting-solutions/high-availability-hosting/)[Agency Hosting](https://www.liquidweb.com/hosting-solutions/hosting-for-agencies/)[SMB Hosting](https://www.liquidweb.com/hosting-solutions/small-business-web-hosting/)[AI Hosting](https://www.liquidweb.com/ai-server-hosting/)[Windows Hosting](https://www.liquidweb.com/windows-server-hosting/)
**Partnerships**
[Hosting Affiliate Program](https://www.liquidweb.com/partner-programs/hosting-affiliate-program/)[Partner Programs](https://www.liquidweb.com/partner-programs/)[Refer-a-Friend](https://www.liquidweb.com/refer-a-friend/)
**Resources**
[Help Docs](https://www.liquidweb.com/help-docs/)[Resource Center](https://resources.liquidweb.com/)[Web](https://www.liquidweb.com/tools/) [Hosting Tools](https://www.liquidweb.com/tools/)[Dedicated Servers](https://www.liquidweb.com/dedicated-server/)[Managed Hosting](https://www.liquidweb.com/managed-hosting/)[Financial Hosting](https://www.liquidweb.com/financial-services/)[Cloud Hosting](https://www.liquidweb.com/what-is-cloud-hosting/)[Web Hosting](https://www.liquidweb.com/what-is-web-hosting/)[Ecommerce](https://www.liquidweb.com/ecommerce/)[HIPAA](https://www.liquidweb.com/hipaa-compliant-hosting/)[VPS](https://www.liquidweb.com/vps/)
Software & Design
[The Events Calendar](https://theeventscalendar.com/)[Restrict Content Pro](https://restrictcontentpro.com/)[Modern Tribe](https://moderntribeagency.com/)[MemberDash](https://memberdashwp.com/)[Kadence WP](https://www.kadencewp.com/)[LearnDash](https://www.learndash.com/)[IconicWP](https://iconicwp.com/)[SolidWP](https://solidwp.com/)[GiveWP](https://givewp.com/)
**Company**
[Contact](https://www.liquidweb.com/contact-us/)[Terms of Service](https://www.liquidweb.com/policies/terms-of-service/)[Privacy Policy](https://www.liquidweb.com/policies/privacy-policy/)[Customer Stories](https://www.liquidweb.com/case-studies/)[Data Centers](https://www.liquidweb.com/data-centers/)[Compliance](https://www.liquidweb.com/compliance-hosting/)[Careers](https://www.liquidweb.com/careers/)[About](https://www.liquidweb.com/about-us/)[Sitemap](https://www.liquidweb.com/sitemap/)[Hosting Coupons](https://www.liquidweb.com/hosting-coupons/)
Liquid Web, a [web hosting](https://www.liquidweb.com/hosting/) company with 18 [data centers](https://www.liquidweb.com/data-centers/) globally








[](https://hostadvice.com/hosting-company/liquidweb-reviews/)[](https://hostadvice.com/hosting-company/liquidweb-reviews/)

Β© 2026 Liquid Web, LLC
[Privacy Policy](https://www.liquidweb.com/policies/privacy-policy/)
\* Promotions may be exclusively available to new customers and cannot be applied to existing accounts. Qualification is at the sole discretion of Liquid Web. [Reach out](https://www.liquidweb.com/contact-us/) with questions.
## Wait! Get exclusive hosting insights
Subscribe to our newsletter and stay ahead of the competition with expert advice from our hosting pros.
- [Solutions](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
Toggle child menu
- Solutions by industry
[Ecommerce](https://www.liquidweb.com/hosting-solutions/ecommerce-hosting/)
Secure, compliant infrastructure for regulated online sales
[Financial Services](https://www.liquidweb.com/hosting-solutions/financial-services-hosting/)
High-trust hosting built for security and compliance
[Agencies](https://www.liquidweb.com/hosting-solutions/hosting-for-agencies/)
Fast, flexible hosting for high-traffic client projects
[Healthcare](https://www.liquidweb.com/hipaa-hosting/)
HIPAA-ready environments for protected health data
Solutions by outcomes
[Compliance](https://www.liquidweb.com/compliance-hosting/)
Hosting aligned with HIPAA, PCI, GDPR, and audit readiness
[Launch](https://www.liquidweb.com/configuration/cloud-vps/)
Configure a high-performance server in minutes
[Commerce Scale](https://www.liquidweb.com/enterprise-hosting/ecommerce/)
Infrastructure built to handle surges, orders, and growth
[Disaster Recovery](https://www.liquidweb.com/hosting-add-ons/disaster-recovery-solutions/)
Redundant, resilient systems for rapid recovery and uptime
- [VPS Hosting](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
Toggle child menu
- [VPS Packages](https://www.liquidweb.com/vps-hosting/packages/)
[Cloud VPS Hosting](https://www.liquidweb.com/vps-hosting/cloud-vps/)
[Windows VPS Hosting](https://www.liquidweb.com/windows-vps-hosting/)
[Linux VPS Hosting](https://www.liquidweb.com/linux-vps-hosting/)
[Managed VPS](https://www.liquidweb.com/vps-hosting/managed-vps/)
[View All VPS Hosting](https://www.liquidweb.com/vps-hosting/)
- [Dedicated Servers](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
Toggle child menu
- [Bare Metal Servers](https://www.liquidweb.com/dedicated-server-hosting/bare-metal/)
[Bare Metal Packages](https://www.liquidweb.com/dedicated-server-hosting/packages/)
[Managed Dedicated](https://www.liquidweb.com/dedicated-server-hosting/managed-servers/)
[Cloud Metal Packages](https://www.liquidweb.com/cloud-hosting/packages/)
[View All Dedicated Servers](https://www.liquidweb.com/dedicated-server-hosting/)
- [Managed Hosting](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
Toggle child menu
- [Managed Hosting](https://www.liquidweb.com/managed-hosting-services/)
[Managed Servers](https://www.liquidweb.com/managed-hosting-services/servers/)
[Managed Applications](https://www.liquidweb.com/managed-hosting-services/applications/)
- [WordPress](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
Toggle child menu
- [Hosting for WordPress](https://www.liquidweb.com/wordpress-hosting/)
[Managed Hosting for WordPress](https://www.liquidweb.com/wordpress-hosting/managed-wordpress/)
[VPS for WordPress](https://www.liquidweb.com/wordpress-hosting/vps-wordpress/)
[Dedicated WordPress](https://www.liquidweb.com/wordpress-hosting/dedicated-wordpress/)
[WooCommerce Hosting](https://www.liquidweb.com/woocommerce-hosting/)
[WordPress Plugins](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
[Kadence WP](https://www.liquidweb.com/hosting-add-ons/premium-wordpress-plugins/kadence-wp/)
[The Events Calendar](https://www.liquidweb.com/hosting-add-ons/premium-wordpress-plugins/the-events-calendar/)
[Give](https://www.liquidweb.com/hosting-add-ons/premium-wordpress-plugins/give/)
[LearnDash](https://www.liquidweb.com/hosting-add-ons/premium-wordpress-plugins/learndash/)
- [GPU Hosting](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
Toggle child menu
- [GPU Hosting](https://www.liquidweb.com/gpu-hosting/)
[NVIDIA GPU Hosting](https://www.liquidweb.com/gpu-hosting/nvidia/)
[AI Training & Interface](https://www.liquidweb.com/ai-server-hosting/)
- [Products](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/)
Toggle child menu
- Compute
[Cloud Servers](https://www.liquidweb.com/cloud-hosting/)
Scalable, high-speed compute
[Dedicated Servers](https://www.liquidweb.com/dedicated-server-hosting/)
Reliability, power, and control
[Private Cloud](https://www.liquidweb.com/private-cloud-hosting/)
Isolated, enterprise-grade cloud
[GPU](https://www.liquidweb.com/gpu-hosting/)
Accelerated for AI & ML
[Containers](https://www.liquidweb.com/container-hosting/)
Portable workloads for any app
Platform services
[Cloud Storage](https://www.liquidweb.com/hosting-add-ons/cloud-storage-services/)
Storage for growing data needs
[Backups & DR](https://www.liquidweb.com/hosting-add-ons/disaster-recovery-solutions/)
Protection for critical workloads
[Global Private Fabric](https://www.liquidweb.com/global-private-fabric/)
Unify networks across servers
[Security & Protection](https://www.liquidweb.com/hosting-add-ons/server-protection/)
Advanced defense for data
[Load Balancing](https://www.liquidweb.com/hosting-add-ons/load-balancer-solutions/)
Optimized traffic distribution
Applications
[WordPress](https://www.liquidweb.com/wordpress-hosting/)
Optimized for fast, secure sites
[WooCommerce](https://www.liquidweb.com/woocommerce-hosting/)
Performance for scalable stores
[Magento](https://www.liquidweb.com/magento-hosting/)
Commerce-ready, built to scale
[Log in](https://www.liquidweb.com/access-account/)
- [System status](https://status.liquidweb.com/)
- [Support \| Get Help](https://www.liquidweb.com/support/)
```
```
Close
to navigateto close
[See all results](https://www.liquidweb.com/?s=) |
| Readable Markdown | ## What is Screen?
Screen is a terminal program in Linux which allows us to use a virtual (VT100 terminal) as full-screen window manager which multiplexes an open physical terminal between multiple processes, which are typically, interactive shells. It allows us to access multiple terminal sessions within a single terminal or a remote terminal session. It is most useful when addressing multiple Linux shell commands on the command line, as well as separating commands from the shell that started the commands.
Screen also allows a user to initiate a command from one terminal, disconnect from that terminal, and then reconnect from a different location to that same terminal, while using a different terminal without having to restart the command. This simply lets a user better control multiple and separate command windows.
Screen also lets multiple remote computers connect to the same screen session at once. This allows multiple users to connect to the same screen session allowing a second user to follow along with another administrator working on a server.
## Basic Commands
Screen is started by using the following screen command:
```
screen
```
### Screen Flags
Here is a list of some of the more common flags and how we can use them.
| | | |
|---|---|---|
| **Flag** | **D****escription** | **E****xample** |
| \-ls | Lists the current screen sessions | screen -ls |
| \-aS | Create and names a screen session which include all capabilities | screen -aS screenname |
| \-r | Resume a detached screen session | screen -r (name\|pid) |
| \-x | Attach to an attached screen session | screen -x (name\|pid) |
| \-d | Detach an attached screen session | screen -d (name\|pid) |
| \-d \-m | Start an new screen session in detached mode and run \$command | screen -d -m \$command |
| \-DR | Force disconnect of current user and reconnect with your user | screen -DR |
| \-wipe | Removes all dead screen sessions. (Sessions that are unreachable) | screen -wipe |
### Default Session Key Bindings
While inside the screen session, *ctrl+a* activates the key bindings. The following table shows some of the default key bindings:
| | |
|---|---|
| **key** | **binding** |
| ? | Show key bindings. |
| A | Set a title for the current window. |
| c | Create a new window. |
| n | Switch to the next window. |
| p | Switch to the previous window. |
| 0-9 | Switch to window number n. |
| w | Show a list of windows. |
| β | Present a list of windows for selection. |
| F | Resize the window to the current region size. |
| \[ or esc | Enter copy/scrollback mode. |
| k | Destroy current window. |
## Screen Examples
To get a full list of available screens, use this command:
```
screen -ls
```
we will then see output similar to this:
```
There is a screen on:
26092.ttyp0.host
(Attached) 1 Socket in /tmp/screens/S-root.
```
This output typically shows us the currently running screens. As you can see by the β*(Attached)*β output, the 26092 session is currently attached to a terminal. Since this screen is currently attached, we can detach it remotely using this command.
```
screen -d 26092
```
If another user is logged onto this screen session and actively working, this modification will kill their session. So, beware of detaching screen sessions this way. To reattach to that same screen, run this command.
```
screen -r 26092
```
We can detach and reattach to the screen concurrently using this command.
```
screen -d -r 26092
```
In order to create a new screen session called LW, we can enter this command.
```
screen -S LW
```
## Modifying Screens Behavior
### **Scrollback**
To enable scrollback in xterm, we can add the following information to our *~/.screenrc* file on our workstation.
```
# Enable mouse scrolling and scroll bar history scrolling
termcapinfo xterm* ti@:te@
```
### Logging
If we use the *\-L* option with screen, it tells screen to turn on the automatic logging output for the window. This will create a file within the current directory, with the name *screenlog.\#* where *\#* is the ID number for that screen beginning from 0.
```
screen -L -S LW
```
### **Multiuser Screen Sessions**
Multiuser is an excellent option to use if we need to share our session with others. It is not turned on by default for security reasons but can be enabled easily. In order to allow multiple users to connect to the same screen session, the **multiuser** option must be enabled. Here are the steps needed to complete this task.
1. Begin by logging in to the server and starting the screen session via the command line.
2. Next, type *Ctrl-a* to enter the command mode.
3. Now, type in β:β (colon) to enter the screenβs built-in command line.
4. We can now activate the multiuser mode by entering *multiuser on* in the screenβs command line, which appears in a reverse color at the bottom of the console window.
5. To confirm this change, hit Enter or Return.
Multiuser mode can be very useful if we are attempting to demonstrate to someone what we are doing on a server. With this mode on, the other user will be able to follow our keystrokes within that screen session.
## Further Exploration
If more in depth information is required, we can always consult the man page for screen using:
```
man screen
```
## Screen Tricks
To initiate a screen session named **LW** and run the top command in it without attaching to it, nothing will appear to happen but you will see the screen with *screen -ls*:
```
screen -S LW -d -m top
```
To end or kill the LW screen session, use this command:
```
screen -S LW -p 0 -X kill
```
To start a bash session in screen, we can use this command:
```
screen -S LW -d -m /bin/bash
```
To run the ls command inside the screen session use this command:
```
screen -S LW -p 0 -X exec ls /home
```
To end or kill the LW screen session, run this command:
```
screen -S LW -p 0 -X kill
```
To scroll up within a screen window, use this command:
```
CTRL+a then ESC, #Press CTRL KEY and 'A' KEY together and then hit the ESC KEY #to scroll using the arrow keys hit ESC again to exit.
```
## Most Useful Screen Commands
Here is a quick overview of the most useful screen commands that we might need to use.
We should enter these key commands in lower case, but they are shown here in uppercase to make the command more readable.
- Ctrl+A, C β This key command creates a new screen
- Ctrl+A, N (where N is equal to the number of the screen) β This key command switch us to a specific screen
- Ctrl+A, A β This key command switches us to the next screen
- Ctrl+A, W β This key command lets us view a list of screens
- Ctrl+A, β (double quote) β This key command allows us to view the screen picker
- Ctrl+A, Ctrl+D β This key command detaches us from the current session
- screen -R β This key command attaches us to a running screen session
- Ctrl+A, ? β This key command shows us the shortcut key options
There are numerous other commands that we can use to control our screen session, many of which can be viewed by typing β*Ctrl+A ?*β at the prompt. This will bring up a help window that shows us all the available key bindings. For example:
- The β*C-a p*β and β*C-a n*β key sequence can be used to switch to the next or previous window.
- Using the β*C-a N*β key sequence β (where N is a number from 0 to 9, that can will connect to the corresponding screen window.
- The β*C-a w*β key sequence displays a list of all screen windows. The unique ID of each window, along with its name, and running process is displayed, for each individual window. The current window will be marked with an asterisk (\*).
- The β*C-a k*βkey sequence will kill the current window session. We can also type βexitβ to kill the current window. If no other screen sessions are open, screen will simply exits. The β*C-a \\*β key sequence also accomplishes the same task.
- The β*C-a d*β key sequence detaches the from the current screen session.
We can also detach from the screen by closing the terminal that is running our screen utility. Although this may appear to close our terminal session, in reality this simply closes the terminal and unbinds our session from the current terminal. All the commands that were started under our screen will continue to run.
We can also log out from the server and login again, then restart a terminal session and type β*screen -r*β to connect again from where we left off. In case, there are more than one running screen sessions on the server, screen will prompt us for a *host.tty.pid*. For example, say I have two screen sessions. So, when we type the β*screen -r*β command, it gives the following message:
```
$ screen -r There are several suitable screens on:
2999.pts-6.localhost (Detached)
1920.PTS-6.localhost (Detached)
To connect to one of the above detached screens
run, screen -d -r 2999.pts-6.localhost
to resume that screen.
```
## Bottom Line
Screen is an invaluable tool when we must work with the terminal daily. It allows us to utilize a limited amount of screen space while maintaining the full functionality of a terminal window. Additionally, screen has the ability to be used as a teaching tool allowing multiple users to connect to an existing screen and, if we have enabled logging, share that file with the user for later reference.
Are you trying to use the screen command and experiencing some difficulty with the control commands, flags or other options with the program?
Our knowledgeable system administrators and experienced linux technicians are standing by to assist you with the help you need. Open a [chat](https://www.liquidweb.com/blog/how-to-use-the-screen-command-in-linux/) or [ticket](mailto:support@liquidweb.com) with us to speak with us right away\! |
| Shard | 24 (laksa) |
| Root Hash | 16217433953315287024 |
| Unparsed URL | com,liquidweb!www,/blog/how-to-use-the-screen-command-in-linux/ s443 |