🕷️ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 69 (from laksa127)

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
9 hours 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://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/
Last Crawled2026-04-10 17:01:02 (9 hours ago)
First Indexed2017-05-07 12:34:56 (8 years ago)
HTTP Status Code200
Meta Title20 Screen Command Examples to Manage Linux Terminals
Meta DescriptionScreen command is a full-screen software program that can be used to multiplexes a physical console between several processes (typically interactive shells).
Meta Canonicalnull
Boilerpipe Text
Brief: In this guide, we will discuss some useful examples of the screen command. By the end of this guide, users will be able to work with multiple shell sessions using a single Linux terminal window. As Linux users, we often need to work on long-running tasks, such as – downloading or copying large files , executing time-consuming database queries, and so on. Sometimes these important tasks get terminated abruptly due to a session timeout. To mitigate such scenarios, we can use the screen command, which is a full-screen software program that can be used to multiplexes a physical console between several processes (typically interactive shells). It offers a user to open several separate terminal instances inside a single terminal window manager. The screen application is very useful if you are dealing with multiple programs from a command-line interface and for separating programs from the terminal shell. It also allows you to share your sessions with others users and detach/attach terminal sessions. In this guide, we will discuss how to install, configure, and use the screen command on a Linux system. Throughout this guide, we will understand the usage and benefits of the screen command using practical examples. Table of Contents Install Screen Command in Linux Screen Command Syntax 1. Start Screen for the First Time 2. Show Screen Parameter 3. How to List All Open Windows 4. How to Terminate Screen Window Session 5. How to Start a Screen Session with Name 6. Detach the Terminal Session with Screen 7. Re-attach the Terminal Session with Screen 8. Using Multiple Screen Terminal Windows 9. How to Rename a Screen Window 10. Switching Between Screen Terminal Windows 11. How to Move to the Next Screen Window 12. How to Move to the Previous Screen Window 13. How to Switch Between Current and Previous Window 14. How to Jump to a Particular Screen Window 15. How to Split a Screen Window Horizontally 16. How to Split a Screen Window Vertically 17. Enable Screen Logging in Linux 18. Lock Linux Terminal Screen 19. Add Password to Screen Session 20. Leaving Screen Terminal Session Screen Command Cheat Sheet So let’s get started. Install Screen Command in Linux On my Ubuntu Server Edition , the screen command has been installed by default. But, Linux Mint does not have a screen installed by default, so I need to install it first using the apt-get command before using it. Please follow your distribution installation procedure to install the screen. $ sudo apt-get install screen [On Debian, Ubuntu and Mint ] $ sudo yum install screen [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux ] $ sudo emerge -a sys-apps/screen [On Gentoo Linux ] $ sudo apk add screen [On Alpine Linux ] $ sudo pacman -S screen [On Arch Linux ] $ sudo zypper install screen [On OpenSUSE ] Now, let’s verify that the command has been installed successfully: $ screen --version Screen version 4.8.00 (GNU) 05-Feb-20 Actually, the screen is a very good terminal multiplexer program in Linux which is hidden inside hundreds of Linux commands . Let’s start to see the usage of the screen command in Linux with the following examples. Screen Command Syntax The syntax of the screen command is as follows $ screen [OPTIONS] [ CMD [ ARGS ] ] In the above syntax, we can see that all the parameters are options and they are represented by the square brackets ([]) . 1. Start Screen for the First Time Just type the screen at the command prompt. Then the screen will show an interface exactly as the command prompt. $ screen Screen Terminal Program 2. Show Screen Parameter When you enter the screen , you can do all your work as you are in the normal command-line environment. But since the screen is an application, so it has commands or parameters. Type “ Ctrl-A ” and “ ? ” without quotes. Then you will see all commands or parameters on the screen. Screen Terminal Key Bindings To get out of the help screen, you can press the “ space-bar ” button or “ Enter “. (Please note that all shortcuts which use “ Ctrl-A ” are done without quotes). 3. How to List All Open Windows In the previous example, we started a new shell session using the screen command. Now let’s use the ctrl-a + " key combination to list all open windows of the current screen session: List Screen Open Windows In the above output, we can see the number and name of the window. The first column represents the window number and it starts from zero. The next column represents the name of the window and its default format is <user>@<hostname>:<working-directory> . 4. How to Terminate Screen Window Session We can terminate the active window session using the ctrl-a + k key combinations. It is important to note that, this action will interrupt the command execution from the current virtual window. Terminate Screen Window Session In the above output, we can see that the screen command is waiting for the user’s confirmation. It shows the warning message in the left bottom corner. Just like other Linux commands, we can use 'y' to continue or 'n' to abort the operation. 5. How to Start a Screen Session with Name The screen command allows us to create a session with a user-defined name, which comes in handy when there are multiple sessions available. So, let’s use the -S option of the command to create a named session: $ screen -S demo-screen In the above command, the demo-screen is the name of the session. 6. Detach the Terminal Session with Screen One of the advantages of a screen that is you can detach it. Then, you can restore it without losing anything you have done on the screen. Here’s the sample scenario: You are in the middle of SSH on your server. Let’s say that you are downloading a  400MB patch for your system using the wget command . You might also like: How to Secure and Harden OpenSSH Server 8 Most Popular SSH Clients for Linux Basic SSH Command Usage and Configuration in Linux 5 Best Practices to Prevent SSH Brute-Force Login Attacks in Linux The download process is estimated to take 2 hours long. If you disconnect the SSH session, or suddenly the connection is lost by accident, then the download process will stop. You have to start from the beginning again. To avoid that, we can use a screen and detach it. Take a look at this command. First, you have to enter the screen. $ screen Then you can do the download process. For example on my Linux Mint , I am upgrading my dpkg package using the apt command . $ sudo apt install dpkg Sample Output Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: dpkg 1 upgraded, 0 newly installed, 0 to remove and 1146 not upgraded. Need to get 2,583 kB of archives. After this operation, 127 kB of additional disk space will be used. Get:1 http://debian.linuxmint.com/latest/ testing/main dpkg i386 1.16.10 [2,583 kB] 47% [1 dpkg 1,625 kB/2,583 kB 47%] 14,7 kB/s While downloading in progress, you can press “ Ctrl-A ” and “ d “. You will not see anything when you press those buttons. The output will be like this: [detached from 5561.pts-0.mint] pungki@mint ~ $ 7. Re-attach the Terminal Session with Screen After you detach the screen, let’s say you are disconnecting your SSH session and going home. In your home, you start to SSH again to your server and you want to see the progress of your download process. To do that, you need to restore the screen. You can run this command: pungki@mint ~ $ screen -r And you will see that the process you left is still running. When you have more than 1 screen session, you need to type the screen session ID . Use screen -ls to see how many screens are available. pungki@mint ~ $ screen -ls Sample Output pungki@mint ~ $ screen -ls There are screens on: 7849.pts-0.mint (10/06/2021 01:50:45 PM) (Detached) 5561.pts-0.mint (10/06/2021 11:12:05 AM) (Detached) 2 Sockets in /var/run/screen/S-pungki If you want to restore screen 7849.pts-0 .mint, then type this command. pungki@mint ~ $ screen -r 7849 8. Using Multiple Screen Terminal Windows When you need more than 1 screen to do your job, is it possible? Yes, it is. You can run multiple screen windows at the same time. There are 2 (two) ways to do it. First, you can detach the first screen and run another screen on the real terminal. Second, you do a nested screen as shown. To create new windows, use the ctrl-a + c key combination two times to create two new windows. Next, let’s use the ctrl-a + " key combination to list all active windows: List Screen Active Windows In the above output, we can see that now there are three windows. 9. How to Rename a Screen Window In the previous example, we created two new windows. However, their default names are not providing any details about them. In such cases, we can assign some meaningful names to them. We can use the ctrl-a + A key combination to rename the current window session. This key combination prompts a user to set a window title: Rename Screen Window Session 10. Switching Between Screen Terminal Windows In the previous example, we created multiple windows. Now let’s see how to switch between them. First, let’s list all active windows using the ctrl-a + " key combination. Next, use the up or down arrow key to select the appropriate window. Finally, press the enter key to switch to the selected window. Switch Between Screen Windows In this example, we have selected the window with the title – db-query . 11. How to Move to the Next Screen Window We can use the ctrl-a + n key combination to move to the next windows. Let’s understand this with an example. First, switch to the first window and verify it using the ctrl-a + " key combination: Switch to Screen Windows Now, let’s press the ctrl-a + n key combination two times to go to the third window and use the ctrl-a + " key combination to verify the same. Switching Screen Windows In the above output, we can see now we are on the third window. 12. How to Move to the Previous Screen Window In a similar way, we can use the ctrl-a + p combination to switch to the previous window. Currently, we are on the third window. So, let’s use the ctrl-a + p key combination two times and verify that we are on the first window again: Switch to the Previous Screen Window In the above output, we can see that now we came back to the first window. 13. How to Switch Between Current and Previous Window Sometimes, we just want to switch between two windows. In such cases, we can use the ctrl-a + ctrl-a key combination. To understand this, first switch to the first window: Switch to First Screen Window Next, switch to the last window: Move to the Last Screen Window Finally, use the ctrl-a + ctrl-a key combination to jump to the first window again. 14. How to Jump to a Particular Screen Window In the previous examples, we saw various ways to switch between windows. However, sometimes we want to jump to a particular window. In such scenarios, we can use the window numbers. First, let’s use the ctrl-a + " key combination to find the window number: List Screen Window Numbers In the above output, the first column represents the window number. It is important to note that, the screen command starts numbering from zero. Now, let’s use the ctrl-a + 2 key combination to jump to the third window and verify that we are in the correct window: Jump to a Particular Screen Window 15. How to Split a Screen Window Horizontally Just like normal terminals, we can also split the screen window. We can use the ctrl-a + S key combination to split the window horizontally. Split Screen Window Horizontally Now, we can use the ctrl-a + tab key combination to jump between the regions. Lastly, we can use the ctrl-a + X key combination to remove the current region. It is important to note that here we have to use an uppercase X character. 16. How to Split a Screen Window Vertically Similarly, we can use the ctrl-a + | key combination to split the current window vertically: Split Screen Window Vertically In addition to this, we can also use the ctrl-a + tab key combination switch between the regions and the ctrl-a + X key combination to close the current region. 17. Enable Screen Logging in Linux Sometimes it is important to record what you have done while you are in the console. Let’s say you are a Linux Administrator who manages a lot of Linux servers. With this screen logging, you don’t need to write down every single command that you have done. To activate the screen logging function, just press “ Ctrl-A ” and “ H “. (Please be careful, we use a capital ‘ H ’ letters. Using non-capital ‘ h ’, will only create a screenshot of the screen in another file named hardcopy). At the bottom left of the screen, there will be a notification that tells you to like: Creating logfile “ screenlog.0 “. You will find a screenlog.0 file in your home directory. This feature will append everything you do while you are in the screen window. To close the screen to log running activity, press “ Ctrl-A ” and “ H ” again. Another way to activate the logging feature, you can add the parameter “ -L ” when the first time running the screen. The command will be like this. pungki@mint ~ $ screen -L 18. Lock Linux Terminal Screen The screen also has a shortcut to lock the screen. You can press the “ Ctrl-A ” and “ x ” shortcuts to lock the screen. This is handy if you want to lock your screen quickly. Here’s a sample output of the lock screen after you press the shortcut. Screen used by Pungki Arianto on mint. Password: You can use your Linux password to unlock it. 19. Add Password to Screen Session For security reasons, you may want to put the password to your screen session. A Password will be asked whenever you want to re-attach the screen. This password is different from the Lock Screen mechanism above. To make your screen password protected, you can edit the “ $HOME/.screenrc ” file. If the file doesn’t exist, you can create it manually. The syntax will be like this. password crypt_password To create the “ crypt_password ” above, you can use the “ mkpasswd ” command on Linux. Here’s the command with the password “ pungki123 “. pungki@mint ~ $ mkpasswd pungki123 l2BIBzvIeQNOs mkpasswd will generate a hash password as shown above. Once you get the hash password, you can copy it into your “ .screenrc ” file and save it. So the “ .screenrc ” file will be like this. password l2BIBzvIeQNOs Next time you run the screen and detach it, a password will be asked when you try to re-attach it, as shown below: pungki@mint ~ $ screen -r 5741 Screen password: Type your password, which is “ pungki123 ” and the screen will re-attach again. After you implement this screen password and press “ Ctrl-A ” and “ x “, then the output will be like this. Screen used by Pungki Arianto on mint. Password: Screen password: A Password will be asked to you twice . The first password is your Linux password , and the second password is the password that you put in your .screenrc file. 20. Leaving Screen Terminal Session There are 2 (two) ways to leave the screen. First, we are using “ Ctrl-A ” and “ d ” to detach the screen. Second, we can use the exit command to terminate the screen. You also can use “ Ctrl-A ” and “ K ” to kill the screen. Screen Command Cheat Sheet Command Description screen -S <session_name> Start a new session with session name. screen -ls List running sessions / screens. screen -x Attach to a running session. screen -r <session_name> Attach to a running session with name. screen -d <session_name> Detach a running session. Ctrl-a c Create new window. Ctrl-a Ctrl-a Change to last-visited active window. Ctrl-a <number> Change to window by number. Ctrl-a ' <number or title> Change to window by number or name. Ctrl-a n or Ctrl-a <space> Change to next window in list. Ctrl-a p or Ctrl-a <backspace> Change to previous window in list. Ctrl-a " See window list. Ctrl-a w Show window bar. Ctrl-a k Kill current window. Ctrl-a \ Kill all windows. Ctrl-a A Rename current window. Ctrl-a S Split display horizontally. Ctrl-a | or Ctrl-a V Split display vertically. Ctrl-a tab Jump to next display region. Ctrl-a X Remove current region. Ctrl-a Q Remove all regions but the current one. Ctrl-a H Enable logging in the screen session. Ctrl-a x Lock (password protect) display. That’s some of the screen command usage on daily basis. There are still a lot of features inside the screen command . You may see the screen man page for more detail. Do you know of any other best example of the screen command in Linux? Let us know your views in the comments below.
Markdown
[Skip to content](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#content "Skip to content") [![Tecmint: Linux Howtos, Tutorials & Guides](https://www.tecmint.com/wp-content/uploads/2020/07/logo.png)](https://www.tecmint.com/ "Tecmint: Linux Howtos, Tutorials & Guides") Menu Menu - [Learn Linux](https://www.tecmint.com/free-online-linux-learning-guide-for-beginners/ "Start Learning Linux") - [Linux Distros](https://www.tecmint.com/best-linux-distributions/ "Linux Distributions") - [Linux Distros for Beginners](https://www.tecmint.com/best-linux-distributions-for-beginners/) - [Linux Distros for Experts](https://www.tecmint.com/linux-distro-for-power-users/ "Widely Used Distros") - [New Linux Distros](https://www.tecmint.com/new-linux-distributions/) - [Linux Server Distros](https://www.tecmint.com/10-best-linux-server-distributions/) - [Secure Linux Distros](https://www.tecmint.com/best-security-centric-linux-distributions/) - [CentOS Alternatives](https://www.tecmint.com/centos-alternative-distributions/ "CentOS Alternative Distros") - [RedHat Distributions](https://www.tecmint.com/redhat-based-linux-distributions/ "RedHat Based Distros") - [Debian Distributions](https://www.tecmint.com/debian-based-linux-distributions/ "Debian Based Distros") - [Ubuntu Distributions](https://www.tecmint.com/ubuntu-based-linux-distributions/ "Ubuntu Based Distros") - [Arch Linux Distros](https://www.tecmint.com/arch-based-linux-distributions/ "Arch Linux Based Distros") - [Rolling Linux Distros](https://www.tecmint.com/best-rolling-release-linux-distributions/) - [KDE Linux Distros](https://www.tecmint.com/best-linux-distributions-for-kde-plasma/ "KDE Based Distros") - [Linux Distros for Old PC](https://www.tecmint.com/linux-distributions-for-old-computers/ "Linux Distros for Older Computers") - [Linux Distros for Kids](https://www.tecmint.com/best-linux-distributions-for-kids/) - [Linux Distributions for Students](https://www.tecmint.com/linux-distros-students/) - [Linux Distros for Windows](https://www.tecmint.com/best-alternative-linux-distributions-for-windows-users/) - [Commands](https://www.tecmint.com/category/linux-commands/ "Linux Commands") - [A – Z Linux Commands](https://www.tecmint.com/linux-commands-cheat-sheet/) - [100+ Linux Commands](https://www.tecmint.com/essential-linux-commands/ "Essential Linux Commands") - [Tools](https://www.tecmint.com/category/top-tools/ "Best Linux Software") - [Pro Courses](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/ "Linux Online Courses") - [Bash Scripting](https://pro.tecmint.com/learn-bash-scripting/ "Bash Scripting for Beginners") - [Learn Linux](https://pro.tecmint.com/learn-linux/ "Master Linux in 7 Days") - [AI for Linux](https://pro.tecmint.com/ai-for-linux/ "AI for Linux Course") - [RHCSA Certification](https://pro.tecmint.com/rhcsa-certification-course/ "RHCSA Certification Course") - [RHCE Certification](https://pro.tecmint.com/rhce-certification-course/ "RHCE Certification Course") - [LFCS Certification](https://pro.tecmint.com/lfcs-certification-course/ "LFCS Certification Course") - [eBooks](https://tecmint.gumroad.com/ "Download eBooks") - [RHCSA Exam](https://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ "RHCSA Certification eBook") - [RHCE Exam](https://www.tecmint.com/how-to-setup-and-configure-static-network-routing-in-rhel/ "RHCE Certification eBook") - [LFCS Exam](https://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ "LFCS Certification eBook") - [LFCE Exam](https://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ "LFCE Certification eBook") - [LFCA Exam](https://www.tecmint.com/understanding-linux-operating-system/ "LFCA Certification eBook") - [Ansible Exam](https://www.tecmint.com/understand-core-components-of-ansible/ "Ansible Certification eBook") - [Sign In](https://pro.tecmint.com/#/portal/account) - [Join Root →](https://pro.tecmint.com/#/portal) [![Tecmint: Linux Howtos, Tutorials & Guides](https://www.tecmint.com/wp-content/uploads/2020/07/logo.png)](https://www.tecmint.com/ "Tecmint: Linux Howtos, Tutorials & Guides") Menu - [Learn Linux](https://www.tecmint.com/free-online-linux-learning-guide-for-beginners/ "Start Learning Linux") - [Linux Distros](https://www.tecmint.com/best-linux-distributions/ "Linux Distributions") - [Linux Distros for Beginners](https://www.tecmint.com/best-linux-distributions-for-beginners/) - [Linux Distros for Experts](https://www.tecmint.com/linux-distro-for-power-users/ "Widely Used Distros") - [New Linux Distros](https://www.tecmint.com/new-linux-distributions/) - [Linux Server Distros](https://www.tecmint.com/10-best-linux-server-distributions/) - [Secure Linux Distros](https://www.tecmint.com/best-security-centric-linux-distributions/) - [CentOS Alternatives](https://www.tecmint.com/centos-alternative-distributions/ "CentOS Alternative Distros") - [RedHat Distributions](https://www.tecmint.com/redhat-based-linux-distributions/ "RedHat Based Distros") - [Debian Distributions](https://www.tecmint.com/debian-based-linux-distributions/ "Debian Based Distros") - [Ubuntu Distributions](https://www.tecmint.com/ubuntu-based-linux-distributions/ "Ubuntu Based Distros") - [Arch Linux Distros](https://www.tecmint.com/arch-based-linux-distributions/ "Arch Linux Based Distros") - [Rolling Linux Distros](https://www.tecmint.com/best-rolling-release-linux-distributions/) - [KDE Linux Distros](https://www.tecmint.com/best-linux-distributions-for-kde-plasma/ "KDE Based Distros") - [Linux Distros for Old PC](https://www.tecmint.com/linux-distributions-for-old-computers/ "Linux Distros for Older Computers") - [Linux Distros for Kids](https://www.tecmint.com/best-linux-distributions-for-kids/) - [Linux Distributions for Students](https://www.tecmint.com/linux-distros-students/) - [Linux Distros for Windows](https://www.tecmint.com/best-alternative-linux-distributions-for-windows-users/) - [Commands](https://www.tecmint.com/category/linux-commands/ "Linux Commands") - [A – Z Linux Commands](https://www.tecmint.com/linux-commands-cheat-sheet/) - [100+ Linux Commands](https://www.tecmint.com/essential-linux-commands/ "Essential Linux Commands") - [Tools](https://www.tecmint.com/category/top-tools/ "Best Linux Software") - [Pro Courses](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/ "Linux Online Courses") - [Bash Scripting](https://pro.tecmint.com/learn-bash-scripting/ "Bash Scripting for Beginners") - [Learn Linux](https://pro.tecmint.com/learn-linux/ "Master Linux in 7 Days") - [AI for Linux](https://pro.tecmint.com/ai-for-linux/ "AI for Linux Course") - [RHCSA Certification](https://pro.tecmint.com/rhcsa-certification-course/ "RHCSA Certification Course") - [RHCE Certification](https://pro.tecmint.com/rhce-certification-course/ "RHCE Certification Course") - [LFCS Certification](https://pro.tecmint.com/lfcs-certification-course/ "LFCS Certification Course") - [eBooks](https://tecmint.gumroad.com/ "Download eBooks") - [RHCSA Exam](https://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ "RHCSA Certification eBook") - [RHCE Exam](https://www.tecmint.com/how-to-setup-and-configure-static-network-routing-in-rhel/ "RHCE Certification eBook") - [LFCS Exam](https://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ "LFCS Certification eBook") - [LFCE Exam](https://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ "LFCE Certification eBook") - [LFCA Exam](https://www.tecmint.com/understanding-linux-operating-system/ "LFCA Certification eBook") - [Ansible Exam](https://www.tecmint.com/understand-core-components-of-ansible/ "Ansible Certification eBook") - [Sign In](https://pro.tecmint.com/#/portal/account) - [Join Root →](https://pro.tecmint.com/#/portal) # Getting Started with Linux Screen Command \[20 Useful Examples\] [Pungki Arianto](https://www.tecmint.com/author/pungkiarianto/ "View all posts by Pungki Arianto") Last Updated: July 13, 2023 Read Time: 13 mins Categories [Linux Commands](https://www.tecmint.com/category/linux-commands/) [53 Comments](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comments) **New to Linux commands?** Our [100+ Essential Linux Commands](https://pro.tecmint.com/linux-commands-series/) course covers everything you used in this guide and a lot more with real examples and explanations. ***Brief: In this guide, we will discuss some useful examples of the screen command. By the end of this guide, users will be able to work with multiple shell sessions using a single Linux terminal window.*** As Linux users, we often need to work on long-running tasks, such as – downloading or [copying large files](https://www.tecmint.com/cp-command-examples/ "Copy Files and Directories in Linux"), executing time-consuming database queries, and so on. Sometimes these important tasks get terminated abruptly due to a session timeout. To mitigate such scenarios, we can use the **screen** command, which is a full-screen software program that can be used to multiplexes a physical console between several processes (typically interactive shells). It offers a user to open several separate terminal instances inside a single terminal window manager. **You might also like:** - [How to Use ‘Tmux Terminal’ to Access Multiple Terminals Inside a Single Console](https://www.tecmint.com/tmux-to-access-multiple-linux-terminals-inside-a-single-console/ "Tmux - Access Multiple Linux Terminals") - [5 Useful Tips for Better Tmux Terminal Sessions](https://www.tecmint.com/tips-for-tmux-terminal-sessions/ "Tmux Terminal Sessions Tips") The **screen** application is very useful if you are dealing with multiple programs from a command-line interface and for separating programs from the terminal shell. It also allows you to share your sessions with others users and detach/attach terminal sessions. In this guide, we will discuss how to install, configure, and use the **screen command** on a Linux system. Throughout this guide, we will understand the usage and benefits of the **screen command** using practical examples. Table of Contents Toggle - [Install Screen Command in Linux](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#Install_Screen_Command_in_Linux) - [Screen Command Syntax](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#Screen_Command_Syntax) - [1\. Start Screen for the First Time](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#1_Start_Screen_for_the_First_Time) - [2\. Show Screen Parameter](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#2_Show_Screen_Parameter) - [3\. How to List All Open Windows](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#3_How_to_List_All_Open_Windows) - [4\. How to Terminate Screen Window Session](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#4_How_to_Terminate_Screen_Window_Session) - [5\. How to Start a Screen Session with Name](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#5_How_to_Start_a_Screen_Session_with_Name) - [6\. Detach the Terminal Session with Screen](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#6_Detach_the_Terminal_Session_with_Screen) - [7\. Re-attach the Terminal Session with Screen](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#7_Re-attach_the_Terminal_Session_with_Screen) - [8\. Using Multiple Screen Terminal Windows](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#8_Using_Multiple_Screen_Terminal_Windows) - [9\. How to Rename a Screen Window](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#9_How_to_Rename_a_Screen_Window) - [10\. Switching Between Screen Terminal Windows](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#10_Switching_Between_Screen_Terminal_Windows) - [11\. How to Move to the Next Screen Window](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#11_How_to_Move_to_the_Next_Screen_Window) - [12\. How to Move to the Previous Screen Window](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#12_How_to_Move_to_the_Previous_Screen_Window) - [13\. How to Switch Between Current and Previous Window](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#13_How_to_Switch_Between_Current_and_Previous_Window) - [14\. How to Jump to a Particular Screen Window](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#14_How_to_Jump_to_a_Particular_Screen_Window) - [15\. How to Split a Screen Window Horizontally](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#15_How_to_Split_a_Screen_Window_Horizontally) - [16\. How to Split a Screen Window Vertically](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#16_How_to_Split_a_Screen_Window_Vertically) - [17\. Enable Screen Logging in Linux](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#17_Enable_Screen_Logging_in_Linux) - [18\. Lock Linux Terminal Screen](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#18_Lock_Linux_Terminal_Screen) - [19\. Add Password to Screen Session](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#19_Add_Password_to_Screen_Session) - [20\. Leaving Screen Terminal Session](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#20_Leaving_Screen_Terminal_Session) - [Screen Command Cheat Sheet](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#Screen_Command_Cheat_Sheet) So let’s get started. ### Install Screen Command in Linux On my **Ubuntu Server Edition**, the **screen** command has been installed by default. But, **Linux Mint** does not have a **screen** installed by default, so I need to install it first using the **[apt-get command](https://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/ "apt-get command examples")** before using it. Please follow your distribution installation procedure to install the screen. ``` $ sudo apt-get install screen [On Debian, Ubuntu and Mint] $ sudo yum install screen [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux] $ sudo emerge -a sys-apps/screen [On Gentoo Linux] $ sudo apk add screen [On Alpine Linux] $ sudo pacman -S screen [On Arch Linux] $ sudo zypper install screen [On OpenSUSE] ``` Now, let’s verify that the command has been installed successfully: ``` $ screen --version Screen version 4.8.00 (GNU) 05-Feb-20 ``` Actually, the **screen** is a very good terminal multiplexer program in Linux which is hidden inside hundreds of [Linux commands](https://www.tecmint.com/linux-commands-cheat-sheet/ "A – Z Linux Commands"). Let’s start to see the usage of the **screen** command in Linux with the following examples. ### Screen Command Syntax The syntax of the **screen** command is as follows ``` $ screen [OPTIONS] [ CMD [ ARGS ] ] ``` In the above syntax, we can see that all the parameters are options and they are represented by the square brackets `([])`. ### 1\. Start Screen for the First Time Just type the **screen** at the command prompt. Then the **screen** will show an interface exactly as the command prompt. ``` $ screen ``` ![Screen Terminal Program](https://www.tecmint.com/wp-content/uploads/2013/10/Screen-Terminal-Program.png) Screen Terminal Program ### 2\. Show Screen Parameter When you enter the **screen**, you can do all your work as you are in the normal command-line environment. But since the **screen** is an application, so it has commands or parameters. Type “**Ctrl-A**” and “**?**” without quotes. Then you will see all commands or parameters on the screen. ![Screen Terminal Key Bindings](https://www.tecmint.com/wp-content/uploads/2013/10/Screen-Terminal-Key-Bindings.png) Screen Terminal Key Bindings To get out of the help screen, you can press the “**space-bar**” button or “**Enter**“. (Please note that all shortcuts which use “**Ctrl-A**” are done without quotes). ### 3\. How to List All Open Windows In the previous example, we started a new shell session using the screen command. Now let’s use the `ctrl-a + "` key combination to list all open windows of the current screen session: ![List Screen Open Windows](https://www.tecmint.com/wp-content/uploads/2021/08/List-Screen-Open-Windows.png) List Screen Open Windows In the above output, we can see the number and name of the window. The first column represents the window number and it starts from zero. The next column represents the name of the window and its default format is `<user>@<hostname>:<working-directory>`. ### 4\. How to Terminate Screen Window Session We can terminate the active window session using the `ctrl-a + k` key combinations. It is important to note that, this action will interrupt the command execution from the current virtual window. ![Terminate Screen Window Session](https://www.tecmint.com/wp-content/uploads/2021/08/Terminate-Screen-Window-Session.png) Terminate Screen Window Session In the above output, we can see that the **screen** command is waiting for the user’s confirmation. It shows the warning message in the left bottom corner. Just like other Linux commands, we can use `'y'` to continue or `'n'` to abort the operation. ### 5\. How to Start a Screen Session with Name The **screen** command allows us to create a session with a user-defined name, which comes in handy when there are multiple sessions available. So, let’s use the `-S` option of the command to create a named session: ``` $ screen -S demo-screen ``` In the above command, the **demo-screen** is the name of the session. ### 6\. Detach the Terminal Session with Screen One of the advantages of a **screen** that is you can detach it. Then, you can restore it without losing anything you have done on the screen. Here’s the sample scenario: You are in the middle of **SSH** on your server. Let’s say that you are downloading a **400MB** patch for your system using the [wget command](https://www.tecmint.com/10-wget-command-examples-in-linux/ "Wget Command Examples"). **You might also like:** - [How to Secure and Harden OpenSSH Server](https://www.tecmint.com/secure-openssh-server/ "Secure and Harden OpenSSH Server") - [8 Most Popular SSH Clients for Linux](https://www.tecmint.com/ssh-clients-linux/ "SSH Clients for Linux") - [Basic SSH Command Usage and Configuration in Linux](https://www.tecmint.com/ssh-command-usage/ "Basic SSH Command Usage in Linux") - [5 Best Practices to Prevent SSH Brute-Force Login Attacks in Linux](https://www.tecmint.com/prevent-ssh-brute-force-login-attacks/ "Prevent SSH Brute-Force Login Attacks in Linux") The download process is estimated to take **2 hours** long. If you disconnect the **SSH** session, or suddenly the connection is lost by accident, then the download process will stop. You have to start from the beginning again. To avoid that, we can use a screen and detach it. Take a look at this command. First, you have to enter the screen. ``` $ screen ``` Then you can do the download process. For example on my **Linux Mint**, I am upgrading my **dpkg** package using the [apt command](https://www.tecmint.com/apt-advanced-package-command-examples-in-ubuntu/ "Ubuntu apt Command Examples"). ``` $ sudo apt install dpkg ``` Sample Output ``` Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: dpkg 1 upgraded, 0 newly installed, 0 to remove and 1146 not upgraded. Need to get 2,583 kB of archives. After this operation, 127 kB of additional disk space will be used. Get:1 http://debian.linuxmint.com/latest/ testing/main dpkg i386 1.16.10 [2,583 kB] 47% [1 dpkg 1,625 kB/2,583 kB 47%] 14,7 kB/s ``` While downloading in progress, you can press “`Ctrl-A`” and “`d`“. You will not see anything when you press those buttons. The output will be like this: ``` [detached from 5561.pts-0.mint] pungki@mint ~ $ ``` ### 7\. Re-attach the Terminal Session with Screen After you detach the screen, let’s say you are disconnecting your **SSH** session and going home. In your home, you start to **SSH** again to your server and you want to see the progress of your download process. To do that, you need to restore the screen. You can run this command: ``` pungki@mint ~ $ screen -r ``` And you will see that the process you left is still running. When you have more than **1 screen** session, you need to type the screen session **ID**. Use screen **\-ls** to see how many screens are available. ``` pungki@mint ~ $ screen -ls ``` Sample Output ``` pungki@mint ~ $ screen -ls There are screens on: 7849.pts-0.mint (10/06/2021 01:50:45 PM) (Detached) 5561.pts-0.mint (10/06/2021 11:12:05 AM) (Detached) 2 Sockets in /var/run/screen/S-pungki ``` If you want to restore screen **7849\.pts-0**.mint, then type this command. ``` pungki@mint ~ $ screen -r 7849 ``` ### 8\. Using Multiple Screen Terminal Windows When you need more than **1 screen** to do your job, is it possible? Yes, it is. You can run multiple screen windows at the same time. There are 2 (two) ways to do it. First, you can detach the first screen and run another screen on the real terminal. Second, you do a nested screen as shown. To create new windows, use the `ctrl-a + c` key combination two times to create two new windows. Next, let’s use the `ctrl-a + "` key combination to list all active windows: ![List Screen Active Windows](https://www.tecmint.com/wp-content/uploads/2021/08/List-Screen-Active-Windows.png) List Screen Active Windows In the above output, we can see that now there are three windows. ### 9\. How to Rename a Screen Window In the previous example, we created two new windows. However, their default names are not providing any details about them. In such cases, we can assign some meaningful names to them. We can use the `ctrl-a + A` key combination to rename the current window session. This key combination prompts a user to set a window title: ![Rename Screen Window Session](https://www.tecmint.com/wp-content/uploads/2021/08/Rename-Screen-Window-Session.png) Rename Screen Window Session ### 10\. Switching Between Screen Terminal Windows In the previous example, we created multiple windows. Now let’s see how to switch between them. First, let’s list all active windows using the `ctrl-a + "` key combination. Next, use the up or down arrow key to select the appropriate window. Finally, press the enter key to switch to the selected window. ![Switch Between Screen Windows](https://www.tecmint.com/wp-content/uploads/2021/08/Switch-Between-Screen-Windows.png) Switch Between Screen Windows In this example, we have selected the window with the title – **db-query**. ### 11\. How to Move to the Next Screen Window We can use the `ctrl-a + n` key combination to move to the next windows. Let’s understand this with an example. First, switch to the first window and verify it using the `ctrl-a + "` key combination: ![Switch to Screen Windows](https://www.tecmint.com/wp-content/uploads/2021/08/Switch-to-Screen-Windows.png) Switch to Screen Windows Now, let’s press the `ctrl-a + n` key combination two times to go to the third window and use the `ctrl-a + "` key combination to verify the same. ![Switching Screen Windows](https://www.tecmint.com/wp-content/uploads/2021/08/Switching-Screen-Windows.png) Switching Screen Windows In the above output, we can see now we are on the third window. ### 12\. How to Move to the Previous Screen Window In a similar way, we can use the `ctrl-a + p` combination to switch to the previous window. Currently, we are on the third window. So, let’s use the `ctrl-a + p` key combination two times and verify that we are on the first window again: ![Switch to Previous Screen Window](https://www.tecmint.com/wp-content/uploads/2021/08/Switch-to-Previous-Screen-Windows.png) Switch to the Previous Screen Window In the above output, we can see that now we came back to the first window. ### 13\. How to Switch Between Current and Previous Window Sometimes, we just want to switch between two windows. In such cases, we can use the `ctrl-a + ctrl-a` key combination. To understand this, first switch to the first window: ![Switch to First Screen Window](https://www.tecmint.com/wp-content/uploads/2021/08/Switch-to-First-Screen-Window.png) Switch to First Screen Window Next, switch to the last window: ![Move to Last Screen Window](https://www.tecmint.com/wp-content/uploads/2021/08/Move-to-Last-Screen-Window.png) Move to the Last Screen Window Finally, use the `ctrl-a + ctrl-a` key combination to jump to the first window again. ### 14\. How to Jump to a Particular Screen Window In the previous examples, we saw various ways to switch between windows. However, sometimes we want to jump to a particular window. In such scenarios, we can use the window numbers. First, let’s use the `ctrl-a + "` key combination to find the window number: ![List Screen Window Numbers](https://www.tecmint.com/wp-content/uploads/2021/08/List-Screen-Window-Numbers.png) List Screen Window Numbers In the above output, the first column represents the window number. It is important to note that, the screen command starts numbering from zero. Now, let’s use the `ctrl-a + 2` key combination to jump to the third window and verify that we are in the correct window: ![Jump to Particular Screen Window](https://www.tecmint.com/wp-content/uploads/2021/08/Jump-to-Particular-Screen-Window.png) Jump to a Particular Screen Window ### 15\. How to Split a Screen Window Horizontally Just like normal terminals, we can also split the screen window. We can use the `ctrl-a + S` key combination to split the window horizontally. ![Split Screen Window Horizontally](https://www.tecmint.com/wp-content/uploads/2021/08/Split-Screen-Window-Horizontally.png) Split Screen Window Horizontally Now, we can use the `ctrl-a + tab` key combination to jump between the regions. Lastly, we can use the `ctrl-a + X` key combination to remove the current region. It is important to note that here we have to use an uppercase X character. ### 16\. How to Split a Screen Window Vertically Similarly, we can use the `ctrl-a + |` key combination to split the current window vertically: ![Split Screen Window Vertically](https://www.tecmint.com/wp-content/uploads/2021/08/Split-Screen-Window-Vertically.png) Split Screen Window Vertically In addition to this, we can also use the `ctrl-a + tab` key combination switch between the regions and the `ctrl-a + X` key combination to close the current region. ### 17\. Enable Screen Logging in Linux Sometimes it is important to **record** what you have done while you are in the console. Let’s say you are a **Linux Administrator** who manages a lot of Linux servers. With this **screen** logging, you don’t need to write down every single command that you have done. To activate the screen logging function, just press “`Ctrl-A`” and “`H`“. (Please be careful, we use a capital ‘`H`’ letters. Using non-capital ‘`h`’, will only create a screenshot of the screen in another file named hardcopy). At the bottom left of the screen, there will be a notification that tells you to like: Creating logfile “**screenlog.0**“. You will find a **screenlog.0** file in your home directory. This feature will append everything you do while you are in the screen window. To close the screen to log running activity, press “`Ctrl-A`” and “`H`” again. Another way to activate the logging feature, you can add the parameter “`-L`” when the first time running the screen. The command will be like this. ``` pungki@mint ~ $ screen -L ``` ### 18\. Lock Linux Terminal Screen The screen also has a shortcut to **lock** the screen. You can press the “`Ctrl-A`” and “`x`” shortcuts to lock the screen. This is handy if you want to lock your screen quickly. Here’s a sample output of the lock screen after you press the shortcut. ``` Screen used by Pungki Arianto on mint. Password: ``` You can use your Linux password to unlock it. ### 19\. Add Password to Screen Session For security reasons, you may want to put the **password** to your screen session. A Password will be asked whenever you want to **re-attach** the screen. This password is different from the **Lock Screen** mechanism above. To make your screen password protected, you can edit the “**\$HOME/.screenrc**” file. If the file doesn’t exist, you can create it manually. The syntax will be like this. ``` password crypt_password ``` To create the “**crypt\_password**” above, you can use the “**mkpasswd**” command on Linux. Here’s the command with the password “**pungki123**“. ``` pungki@mint ~ $ mkpasswd pungki123 l2BIBzvIeQNOs ``` **mkpasswd** will generate a hash password as shown above. Once you get the hash password, you can copy it into your “**.screenrc**” file and save it. So the “**.screenrc**” file will be like this. ``` password l2BIBzvIeQNOs ``` Next time you run the screen and detach it, a password will be asked when you try to **re-attach** it, as shown below: ``` pungki@mint ~ $ screen -r 5741 Screen password: ``` Type your password, which is “**pungki123**” and the screen will **re-attach** again. After you implement this screen password and press “`Ctrl-A`” and “`x`“, then the output will be like this. ``` Screen used by Pungki Arianto on mint. Password: Screen password: ``` A Password will be asked to you **twice**. The first password is your **Linux password**, and the second password is the password that you put in your **.screenrc** file. ### 20\. Leaving Screen Terminal Session There are **2** (two) ways to leave the screen. First, we are using “`Ctrl-A`” and “`d`” to detach the screen. Second, we can use the exit command to terminate the screen. You also can use “`Ctrl-A`” and “`K`” to kill the screen. ### Screen Command Cheat Sheet | **Command** | **Description** | |---|---| | `screen -S <session_name>` | Start a new session with session name. | | `screen -ls` | List running sessions / screens. | | `screen -x` | Attach to a running session. | | `screen -r <session_name>` | Attach to a running session with name. | | `screen -d <session_name>` | Detach a running session. | | `Ctrl-a c` | Create new window. | | `Ctrl-a Ctrl-a` | Change to last-visited active window. | | `Ctrl-a <number>` | Change to window by number. | | `Ctrl-a ' <number or title>` | Change to window by number or name. | | `Ctrl-a n or Ctrl-a <space>` | Change to next window in list. | | `Ctrl-a p or Ctrl-a <backspace>` | Change to previous window in list. | | `Ctrl-a "` | See window list. | | `Ctrl-a w` | Show window bar. | | `Ctrl-a k` | Kill current window. | | `Ctrl-a \` | Kill all windows. | | `Ctrl-a A` | Rename current window. | | `Ctrl-a S` | Split display horizontally. | | `Ctrl-a | or Ctrl-a V` | Split display vertically. | | `Ctrl-a tab` | Jump to next display region. | | `Ctrl-a X` | Remove current region. | | `Ctrl-a Q` | Remove all regions but the current one. | | `Ctrl-a H` | Enable logging in the screen session. | | `Ctrl-a x` | Lock (password protect) display. | That’s some of the **screen** command usage on daily basis. There are still a lot of features inside the **screen command**. You may see the **screen man page** for more detail. ***Do you know of any other best example of the screen command in Linux? Let us know your views in the comments below.*** Pro TecMint Root Plan Premium Linux Education for Serious Learners ### Take Your Linux Skills to the Next Level Root members get full access to every course, certification prep track, and a growing library of hands-on Linux content — with new courses added every month. What You Get Ad-free access to all premium articles Access to all courses: Learn Linux, AI for Linux, Bash Scripting, Ubuntu Handbook, Golang and more. Access to Linux certifications (RHCSA, RHCE, LFCS and LFCA) Access new courses on release Get access to weekly newsletter Priority help in comments Private Telegram community Connect with the Linux community [Join Root Plan →](https://pro.tecmint.com/#/portal/signup) **\$8/mo** · or **\$59/yr** billed annually Cancel anytime Previous article: [6 Deprecated Linux Commands and Alternative Tools You Should Use](https://www.tecmint.com/deprecated-linux-commands/) Next article: [Scrcpy – Display and Control Your Android Device via Linux Desktop](https://www.tecmint.com/scrcpy-connect-android-linux/) ![Photo of author](https://secure.gravatar.com/avatar/25bda0197fec49687a4e647ed4a682a22e2217f1e9b3f9db1224bbc6fd6f7cb7?s=100&d=blank&r=g) Pungki Arianto Currently I am a Linux/Unix administrator. But I also play Windows both in server and desktop area. Interested in information technology, information security and writing. *** *Each tutorial at **TecMint** is created by a team of experienced Linux system administrators* so that it meets our high-quality *standards.* Join the **[TecMint Weekly Newsletter](https://newsletter.tecmint.com/subscription?f=hj6Ohm9gck3Z0PQ2BBBTh892iaCbDV3jJJa3hD8ULUlubOgnbo8aF44vt2HZfdc36g)** (More Than **156,129** Linux Enthusiasts Have Subscribed) **Was this article helpful?** Please **[add a comment](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#respond)** or **[buy me a coffee](https://www.buymeacoffee.com/tecmint)** to show your appreciation. ## Related Posts [![df Command in Linux](https://www.tecmint.com/wp-content/uploads/2026/03/df-command-linux-disk-space.webp)](https://www.tecmint.com/df-command-linux-disk-space/ "df Command in Linux: Disk Space, Inodes & Real Fixes") [df Command in Linux: Disk Space, Inodes & Real Fixes](https://www.tecmint.com/df-command-linux-disk-space/) [![Fsck Repair Linux Filesystem Errors](https://www.tecmint.com/wp-content/uploads/2018/09/Fsck-Repair-Linux-Filesystem-Errors.png)](https://www.tecmint.com/fsck-repair-file-system-errors-in-linux/ "How to Use fsck to Check and Repair Linux Filesystem Errors") [How to Use fsck to Check and Repair Linux Filesystem Errors](https://www.tecmint.com/fsck-repair-file-system-errors-in-linux/) [![command-line YouTube downloader](https://www.tecmint.com/wp-content/uploads/2026/03/command-line-YouTube-downloader.webp)](https://www.tecmint.com/download-mp3-song-from-youtube-videos/ "YT-DLP: The Easiest Way to Download Videos and Songs from YouTube") [YT-DLP: The Easiest Way to Download Videos and Songs from YouTube](https://www.tecmint.com/download-mp3-song-from-youtube-videos/) [![view disk partitions linux](https://www.tecmint.com/wp-content/uploads/2025/03/view-disk-partitions-linux.png)](https://www.tecmint.com/list-disks-partitions-linux/ "7 Ways to View Disks and Partitions in Linux") [7 Ways to View Disks and Partitions in Linux](https://www.tecmint.com/list-disks-partitions-linux/) [![Check Linux OS Name and Kernel Version](https://www.tecmint.com/wp-content/uploads/2026/03/Check-Linux-OS-Name-and-Kernel-Version.webp)](https://www.tecmint.com/check-linux-os-version/ "How to Check Linux OS Name and Kernel Version [6 Quick Methods]") [How to Check Linux OS Name and Kernel Version \[6 Quick Methods\]](https://www.tecmint.com/check-linux-os-version/) [![Generate and Check Files with MD5 Checksum in Linux](https://www.tecmint.com/wp-content/uploads/2016/10/Generate-Check-File-MD5-Checksum-Linux.png)](https://www.tecmint.com/generate-verify-check-files-md5-checksum-linux/ "How to Generate and Verify MD5 Checksums in Linux [5 Methods]") [How to Generate and Verify MD5 Checksums in Linux \[5 Methods\]](https://www.tecmint.com/generate-verify-check-files-md5-checksum-linux/) ## 53 Comments [Leave a Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#reply-title) 1. ![](https://secure.gravatar.com/avatar/2e5f24769b31c2e6151b8870d6e87eb96fd4068e881ea3649b2194df4116c68f?s=50&d=blank&r=g) adi [August 8, 2025 at 7:07 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-2332339) Setting the correct timezone on an Ubuntu Server ensures accurate timekeeping for logs, scheduled tasks (cron jobs), and system updates. This is especially important for servers running in different geographical regions or used in distributed environments. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-2332339) 2. ![](https://secure.gravatar.com/avatar/a91a689d4ea27812c10ccc4fad14750ff2394f547d3a504d5154d6d69676d407?s=50&d=blank&r=g) Harry Slaughter [July 19, 2024 at 7:55 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-2192304) Much appreciated. I’m a huge fan of screen, but working with it is sometimes challenging :) [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-2192304) 3. ![](https://secure.gravatar.com/avatar/5e64058ab3e68009e84cfd584f6a48d178962877060936bc5cb2385b92656b63?s=50&d=blank&r=g) JohnK [January 31, 2021 at 1:13 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-1425362) Jeezus, I may be many years late but THANK YOU for this wonderful article. So succinct and verbose I love it! You are a genius~\! [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-1425362) 4. ![](https://secure.gravatar.com/avatar/2804fe29e508f95d49a7b61a6c57220d4d0015051dce30652876606ff2d53dd5?s=50&d=blank&r=g) James [July 10, 2020 at 11:47 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-1343595) This guide was really useful and easy to follow. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-1343595) 5. ![](https://secure.gravatar.com/avatar/fdda2ecba519e01eaed6c50bde8493a9ee2e8644f72634bc989859dc1375bcd8?s=50&d=blank&r=g) Paul Größel [March 19, 2020 at 12:49 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-1321973) Another useful command is: “`screen -S NAME -d -m COMMAND`“. This starts a detached session named “NAME” and runs the command “COMMAND” inside. You then can later reattach and see what “COMMAND” is doing with “screen -r NAME” [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-1321973) 6. ![](https://secure.gravatar.com/avatar/29416762f78f30f1ab7735adea7c1a43288554ef1f371cd1c06f6914f2e3d9fc?s=50&d=blank&r=g) Bruce W. Lowther [February 27, 2019 at 7:17 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-1105785) Under: “Using Multiple Screen” you are missing text on the second way to view. Suspect it’s using split screen, but it’s a mystery. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-1105785) 7. ![](https://secure.gravatar.com/avatar/336ee19e31882a81882eb17f9990f490e439dd70a3fb4f348991523222f0ef91?s=50&d=blank&r=g) boris birch [October 5, 2018 at 10:49 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-1043808) Since I started using **lainux** in 1998, I have ALWAYS logged in ROOT on tty1 and \[ME\] on tty3. That way, I can run a long admin task as ROOT and ctrl alt F3 to \[ME\]s X session to continue while ROOT works on his task. Also, if an unscrupulous Indian company takes over my session, claiming it has magical info from Microsoft regarding viruses, I can ctrl alt F1 to get ROOT to kill the browser hosting the Indian company’s process. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-1043808) 8. ![](https://secure.gravatar.com/avatar/79cbd7faf366ad99601f195465a7b64a3931e914f00d9f791036256654216e6d?s=50&d=blank&r=g) Joel [December 15, 2017 at 12:14 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-948595) I’ve been trying to install screen for the past few hours without success. Any help guys. Using ubunto 16.4.3 ``` $ sudo apt-get install screen Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package screen ``` [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-948595) - ![](https://secure.gravatar.com/avatar/111f6b53ad24719104c1cc55e9902f4ef840d8dd7af46c9481ea3d6e0b0040bd?s=50&d=blank&r=g) Ravi Saive [December 15, 2017 at 4:19 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-948660) Make sure you have enabled Ubuntu repositories: To enable all repositories (main, universe, restricted, multiverse), use the following commands: ``` sudo add-apt-repository main sudo add-apt-repository universe sudo add-apt-repository restricted sudo add-apt-repository multiverse ``` [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-948660) - ![](https://secure.gravatar.com/avatar/79cbd7faf366ad99601f195465a7b64a3931e914f00d9f791036256654216e6d?s=50&d=blank&r=g) Joel [December 19, 2017 at 11:38 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-951546) Thank you Ravi. Today after giving up and looking for a Windows machine to use i then tried again and it managed to install. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-951546) 9. ![](https://secure.gravatar.com/avatar/adccb888e5044ce2f10aeda9cb2ce5991878b85e77ea7ab7fd0b1445116a2218?s=50&d=blank&r=g) rupali [June 5, 2017 at 4:33 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-893887) I have a query, how I can install **screen** utility in Virtual desktop (VMware) ??? [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-893887) - ![](https://secure.gravatar.com/avatar/111f6b53ad24719104c1cc55e9902f4ef840d8dd7af46c9481ea3d6e0b0040bd?s=50&d=blank&r=g) Ravi Saive [June 6, 2017 at 10:57 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-894044) @Rupali, In most Linux distributions, screen utility pre-installed, if not just install it with using your package manager. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-894044) - ![](https://secure.gravatar.com/avatar/adccb888e5044ce2f10aeda9cb2ce5991878b85e77ea7ab7fd0b1445116a2218?s=50&d=blank&r=g) rupali [June 6, 2017 at 11:21 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-894048) Thanks Ravi for the reply but It’s not Linux, sorry i forgot to mention we have Solaris as our virtual machine (remote server). Which package manager and commands need to be used in order to install screen utility in Solaris server ???? [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-894048) - ![](https://secure.gravatar.com/avatar/111f6b53ad24719104c1cc55e9902f4ef840d8dd7af46c9481ea3d6e0b0040bd?s=50&d=blank&r=g) Ravi Saive [June 6, 2017 at 12:23 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-894054) @Rupali, To install screen on Solaris 10 and 11: ``` pkgadd -d http://get.opencsw.org/now /opt/csw/bin/pkgutil -U /opt/csw/bin/pkgutil -y -i screen /usr/sbin/pkgchk -L CSWscreen # list files screen -v ``` [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-894054) 10. ![](https://secure.gravatar.com/avatar/1021ac061555e4803f95541bb3e117b49a894b8da236c85d6aa3fabce3f61941?s=50&d=blank&r=g) Rakesh [April 19, 2017 at 2:51 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-884644) Very nice article with easy to understand examples.. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-884644) 11. ![](https://secure.gravatar.com/avatar/b511cdff262fc68e73e06e6b58eba14784278faa87693edb39f93412513cf26c?s=50&d=blank&r=g) sul [January 26, 2016 at 10:34 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-744422) Very nice post. It is also possible to run screen as a detached process with a script. For example screen -d -m script.sh This will start screen as a detached process. Its pretty useful. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-744422) - ![](https://secure.gravatar.com/avatar/111f6b53ad24719104c1cc55e9902f4ef840d8dd7af46c9481ea3d6e0b0040bd?s=50&d=blank&r=g) Ravi Saive [January 27, 2016 at 11:23 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-744593) @Sul, Thanks a ton for the tip, yes you can detach any command or process with screen command as you pointed in your example.. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-744593) 12. ![](https://secure.gravatar.com/avatar/fe1c94fdab8470d133cbf06f1e44601a576ad1602f8a3a4a823914e6be6834cf?s=50&d=blank&r=g) Mr. Man-wai Chang [December 18, 2015 at 11:33 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-725780) I was using GNU Screen, and then I found tmux! Both tools are interesting anyway\! <https://tmux.github.io/> [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-725780) 13. ![](https://secure.gravatar.com/avatar/49e61b9388876415b55bdf9de8a5a29a973ff1fb9f37eee31b38e9e0ab9a55f2?s=50&d=blank&r=g) Mehmet Keçeci [December 17, 2015 at 6:44 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-725359) yum –\> dnf (new command) [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-725359) 14. ![](https://secure.gravatar.com/avatar/fa131545dd339883ecd21d0648e663c666a357252221c693e91695a8e1c6d78c?s=50&d=blank&r=g) Vlad [October 9, 2015 at 5:10 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-682675) it is simple and clear. Thanks a lot\! [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-682675) 15. ![](https://secure.gravatar.com/avatar/adecb6cc049b417666d5e2632afedf9a2cc3bffb4185f8b15826652a7c8e6538?s=50&d=blank&r=g) Ruan [July 27, 2015 at 9:16 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-632192) Man, thanks for the tips [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-632192) 16. ![](https://secure.gravatar.com/avatar/8710d2f7daf3dbbeb1884411353b748e6340bc7a80aa610224d6a1590a8ffe29?s=50&d=blank&r=g) rohit [June 10, 2015 at 6:18 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-594352) Thanks\! [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-594352) 17. ![](https://secure.gravatar.com/avatar/52013cfe72f5ed3aeaf806dd0e759cca9e63eecd85428096589e19f66ab20d43?s=50&d=blank&r=g) Balaji [June 5, 2015 at 4:02 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-589172) Very nice. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-589172) 18. ![](https://secure.gravatar.com/avatar/08acc8ec7d02ae77d59f14ccd8714eaeadd929615476eeef029fb38bcc5ed1cd?s=50&d=blank&r=g) Brad [February 19, 2015 at 10:55 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-488103) Great primer on screen. I was unaware that you could lock a screen, very handy. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-488103) 19. ![](https://secure.gravatar.com/avatar/e5dc35b7348bf1583c9f83750696ea62d110d3b8bb5dd131b9668e093c030e72?s=50&d=blank&r=g) Omer [December 16, 2014 at 3:53 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-419077) Thanks for sharing, you made is super simple. Regards Omer [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-419077) - ![](https://secure.gravatar.com/avatar/25bda0197fec49687a4e647ed4a682a22e2217f1e9b3f9db1224bbc6fd6f7cb7?s=50&d=blank&r=g) Pungki Arianto [December 18, 2014 at 7:41 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-421610) Thank you. Glad to know this article can help you :-) [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-421610) 20. ![](https://secure.gravatar.com/avatar/a2f7827b371464bb4c69b84763845a7b1ef38b53a8579558a2d7b34e36f4ec03?s=50&d=blank&r=g) Arakhne [October 29, 2014 at 3:05 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-351090) Thank you very much. I learned a couple of things today thanks to you\! [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-351090) - ![](https://secure.gravatar.com/avatar/25bda0197fec49687a4e647ed4a682a22e2217f1e9b3f9db1224bbc6fd6f7cb7?s=50&d=blank&r=g) Pungki Arianto [October 29, 2014 at 12:36 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-351675) Hi Arakhne Thank you. Glad to know this article can help you :-) [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-351675) 21. ![](https://secure.gravatar.com/avatar/f0195dbe735c192cd628896e5475c800a62bb676ea5792171cc0da4eb8428761?s=50&d=blank&r=g) Daljeet [September 12, 2014 at 12:54 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-270520) Nice post. Very helpful and informative. Keep it up\! Is there any way to view two screens simultaneously ? Somewhat similar to view files using split command on Vi . Thanks Daljeet [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-270520) - ![](https://secure.gravatar.com/avatar/25bda0197fec49687a4e647ed4a682a22e2217f1e9b3f9db1224bbc6fd6f7cb7?s=50&d=blank&r=g) Pungki Arianto [October 29, 2014 at 12:35 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-351671) Hi Daljeet I’m not sure if screen have a built-in command / parameter to make simultaneously screen view. But I think you can install tmux, as terminal multiplexer. It can split console / terminal. Then after you split your console, you can run screen on each console. I hope this help. Thank you [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-351671) 22. ![](https://secure.gravatar.com/avatar/6e5b68c890bdaa435360f6ea2f0ef43dd4e2fdf3e4db9cb4c7f7213b461c6c07?s=50&d=blank&r=g) IPC Oye [August 21, 2014 at 4:44 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-245925) Hello, how can I see the previous results (output) if they’re long, because when I scroll up when I was inside the ‘screen’ I can’t scroll up to see them. Thanks\! [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-245925) - ![](https://secure.gravatar.com/avatar/25bda0197fec49687a4e647ed4a682a22e2217f1e9b3f9db1224bbc6fd6f7cb7?s=50&d=blank&r=g) Pungki Arianto [August 26, 2014 at 3:48 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-250479) Hi IPC Oye You may press Ctrl – a and Esc to enter Copy mode. It will bring you into Copy Mode. Once you are there, you can use PageUp and PageDown button to scroll. To exit Copy Mode, press Esc one more. I hope this help. Thank you [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-250479) 23. ![](https://secure.gravatar.com/avatar/d2444e26297efee36eabc2c88810f9f56171a18c2298a2c6aae9f43e55c66279?s=50&d=blank&r=g) Pradeep [August 5, 2014 at 3:45 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-232447) Great and really helpful article. This helped me save implementation of log in my project [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-232447) 24. ![](https://secure.gravatar.com/avatar/d753c7ee272efbf1dda98e969cf594f22ceb5c6e7c3b605393c98ad0e0191909?s=50&d=blank&r=g) Jamenson Espindula [August 1, 2014 at 8:33 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-229432) Congratulations for the article! The most screen’s feature I like is “S” option (Split) the Virtual Terminal into two “regions”. Inside each “region” you can have a diferent bash prompt. That is my contribution/sugestion to improve the article. \[\]’s [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-229432) 25. ![](https://secure.gravatar.com/avatar/294bec2665031dc86e3bec6dadfc0c2932cb0a35c248e3dd4bff2891d339b61e?s=50&d=blank&r=g) Karl [May 8, 2014 at 6:11 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-160002) This is great stuff to know, and very much improves my workflow. Thanks\! [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-160002) 26. ![](https://secure.gravatar.com/avatar/04b32533bc9d6bc77042e9a598f2b6864429a793123bc56487fc3149a9ea15d7?s=50&d=blank&r=g) Phil [February 18, 2014 at 1:08 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-123811) Thanks this is a very useful article\! [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-123811) 27. ![](https://secure.gravatar.com/avatar/66d5fb0dc52cb4e20ca125a6485123a2d912bfb45dd20060bbc36d29963f5917?s=50&d=blank&r=g) April [February 14, 2014 at 12:42 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-122608) Great article, Thanks [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-122608) 28. ![](https://secure.gravatar.com/avatar/bac25ee5161eb2f2502c3c6c61d111825d4545367e14ae408f4ae5c239f38cf0?s=50&d=blank&r=g) Wayne [January 30, 2014 at 11:54 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-116137) very useful article, thanks [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-116137) 29. ![](https://secure.gravatar.com/avatar/a3e1e7c5a16e5643016e1e9c5ba7ed4c4acd9ba920a6ba2213f9be54e21cec41?s=50&d=blank&r=g) Bob [December 25, 2013 at 5:17 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-92677) Hi, Very helpfull post. Thanks [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-92677) 30. ![](https://secure.gravatar.com/avatar/6a93ef589a20eb1d0efa3700d329c396b5fcfb4fcdd5b6a1e5f3255448f901a2?s=50&d=blank&r=g) Mohsin\_Suks)co=ck [November 24, 2013 at 1:44 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-74723) Use a different English translator, Mohsin – study harder, you belong where you are :) [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-74723) 31. ![](https://secure.gravatar.com/avatar/0f549a3eefa8e7f2a9077c064b26e0c1e74cd047da1836d725536572028d0ea1?s=50&d=blank&r=g) Mohsin [November 7, 2013 at 5:48 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-66712) Very well written and very well explained. Thank you\! [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-66712) - ![](https://secure.gravatar.com/avatar/25bda0197fec49687a4e647ed4a682a22e2217f1e9b3f9db1224bbc6fd6f7cb7?s=50&d=blank&r=g) Pungki Arianto [December 10, 2013 at 7:13 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-83368) Thank you very much. Hope it’s help. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-83368) 32. ![](https://secure.gravatar.com/avatar/51e16a45c598c677a860b90e3cf8ee2ab1ebb7ef4142d6b68774ecb680949e18?s=50&d=blank&r=g) niraj [October 14, 2013 at 6:07 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-57244) Hi its good doc. You can use the multiple screen like screen -S testing —– it will create a screen with testing name then screen -ls wil show the currently screen attached name There is a screen on: 2063.testing (Attached) 1 Socket in /var/run/screen/S-root. then to connect with that screen screen -x testing — you will be connect to the testing screen. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-57244) 33. ![](https://secure.gravatar.com/avatar/cf3442baabf16a4e694f8be8dd5f939d2e02193351faad260b3347d84c195a27?s=50&d=blank&r=g) Eddie G. [October 14, 2013 at 1:41 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-57165) Because I’m a newbie still in the world of Linux and using the Terminal….I don’t understand the usage of this….does it open up new terminals in one screen? or is it that there are different processes running in the same terminal window?…I have opened more than one terminal and then had them running in different work-spaces, is this something akin to that?…or is it something different?….just looking for a little guidance on this stuff…. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-57165) 34. ![](https://secure.gravatar.com/avatar/5ff2910734c72f44dd995501e27af6fac78545344e25f90cf87366f07988c389?s=50&d=blank&r=g) Kettu [October 13, 2013 at 9:40 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-57002) Thank you for this article. I’ve been using the screen for several years but haven’t heard of password-protecting screen session before. After reading comments I’m definitely gonna give tmux a try. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-57002) 35. ![](https://secure.gravatar.com/avatar/b041bd6b6f6a39e55f50de9c204ce23afd7339bce92a3b7ac7d03a9b5f495d5d?s=50&d=blank&r=g) Matt [October 11, 2013 at 5:28 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-56208) screen is dead. Tmux is a much better replacement. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-56208) 36. ![](https://secure.gravatar.com/avatar/c3b3ff3916c8498a99fa43453d6caa32e5c06b62a196cfcf0e44d37b97ccbbb0?s=50&d=blank&r=g) Rick Stanley [October 11, 2013 at 3:25 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-56172) Screen is fine for the plain console but for a GUI environment, such as KDE which I use, I prefer Yakuake, <http://kde-apps.org/content/show.php?content=29153> Multiple tabbed windows, drops down with F12 and stays as long as I need it, etc… Guake for Gnome, <http://guake.org/> [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-56172) - ![](https://secure.gravatar.com/avatar/aa06cf48651ce63ae5a129014289b215a18d01019b1d61907b48e1a7ad328713?s=50&d=blank&r=g) nemocorp [October 12, 2013 at 6:05 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-56592) No comparison. Yakuake is just another terminal. Terminal is terminal multiplexer with session you can detach and reconnect later on a remote machine. See it much more as a window manager in text mode [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-56592) 37. ![](https://secure.gravatar.com/avatar/0b4e5424bea4a80b89a40c7327b1671d0f37d31c2062ae3117ed9299a6f2ec57?s=50&d=blank&r=g) Ganesh [October 10, 2013 at 3:37 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-55817) Great Article, Nice to have this info for the System admin who are running the time consuming process for remote location…Thanks again , Keep the good work. [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-55817) - ![](https://secure.gravatar.com/avatar/25bda0197fec49687a4e647ed4a682a22e2217f1e9b3f9db1224bbc6fd6f7cb7?s=50&d=blank&r=g) Pungki Arianto [October 11, 2013 at 3:30 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-56363) Thank you. If you’re using Ubuntu Server, I just found that they also have byobu application which is similar with screen but more advanced. Please take a look at <https://help.ubuntu.com/10.04/serverguide/byobu.html> [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-56363) 38. ![](https://secure.gravatar.com/avatar/8b28b2436ea6612f362de1f6c4fcac193f758d85b6a7eb27908e96b732080bb1?s=50&d=blank&r=g) RoseHosting [October 9, 2013 at 6:33 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-55640) A more advanced alternative to the standard GNU screen is tmux. tmux offers a variety of improvements such as status bar, multiple sessions in same terminal, search, ..etc [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-55640) - ![](https://secure.gravatar.com/avatar/25bda0197fec49687a4e647ed4a682a22e2217f1e9b3f9db1224bbc6fd6f7cb7?s=50&d=blank&r=g) Pungki Arianto [October 10, 2013 at 3:24 pm](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-55960) Thank you for your share. It’s really valuable for me :) [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-55960) - ![](https://secure.gravatar.com/avatar/aa06cf48651ce63ae5a129014289b215a18d01019b1d61907b48e1a7ad328713?s=50&d=blank&r=g) nemocorp [October 11, 2013 at 5:38 am](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-56211) tmux combine with tmuxinator is definitively a screen killer. Used to use screen for years switch 2 years ago for tmux. Never go back [Reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#comment-56211) ### Got Something to Say? Join the Discussion... [Cancel reply](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#respond) Pro TecMint · Root Plan ### Take Your Linux Skills to the Next Level Root members get full access to every course, certification prep track, and a growing library of hands-on Linux content — with new courses added every month. What You Get Ad-free access to all premium articles Access to all courses: Learn Linux, AI for Linux, Bash Scripting, Ubuntu Handbook, Golang and more. Access to Linux certifications (RHCSA, RHCE, LFCS and LFCA) Access new courses on release Get access to weekly newsletter Priority help in comments Private Telegram community Connect with the Linux community [Join Root Plan →](https://pro.tecmint.com/#/portal/signup) **\$8/mo** · or **\$59/yr** Cancel anytime Pro TecMint Root Plan 14 courses ### Premium Linux Courses [Red Hat Certified System Administrator (RHCSA) Learn RHEL 10 from scratch and confidently pass the EX200 certification exam.](https://pro.tecmint.com/rhcsa-certification-course/?utm_source=tecmint&utm_medium=sidebar&utm_campaign=rhcsa) [Red Hat Certified Engineer (RHCE) Learn RHEL 10 automation and confidently pass the EX294 certification exam.](https://pro.tecmint.com/rhce-certification-course/?utm_source=tecmint&utm_medium=sidebar&utm_campaign=rhce) [AI for Linux Discover how to use AI in Linux to automate tasks, analyze logs, and make sysadmin tasks more efficient and less time-consuming.](https://pro.tecmint.com/ai-for-linux/?utm_source=tecmint&utm_medium=sidebar&utm_campaign=ai-linux) [SSH CourseIN PROGRESS From SSH fundamentals to enterprise-grade mastery in 50 comprehensive chapters covering authentication, security, Git, automation, tunneling, and DevOps workflows.](https://pro.tecmint.com/ssh-complete-course/?utm_source=tecmint&utm_medium=sidebar&utm_campaign=ssh-course) [Linux Interview Handbook A complete 3-part interview preparation series with 240+ questions covering Linux basics to advanced DevOps tools.](https://pro.tecmint.com/linux-interview-questions/?utm_source=tecmint&utm_medium=sidebar&utm_campaign=interview) [Join Root — Access All Courses →](https://pro.tecmint.com/#/portal/signup?utm_source=tecmint&utm_medium=sidebar&utm_campaign=root) From **\$8/mo** · or **\$59/yr** · Cancel anytime ## Linux Server Monitoring Tools [24 Best Command Line Tools to Monitor Linux Performance](https://www.tecmint.com/command-line-tools-to-monitor-linux-performance/) [How to Monitor Performance Of CentOS 8/7 Server Using Netdata](https://www.tecmint.com/monitor-centos-server-performance/) [screenFetch – An Ultimate System Information Generator for Linux](https://www.tecmint.com/screenfetch-system-information-generator-for-linux/) [How to Check Integrity of File and Directory Using “AIDE” in Linux](https://www.tecmint.com/check-integrity-of-file-and-directory-using-aide-in-linux/) [3 Methods to Check Apache Server Status and Uptime in Linux](https://www.tecmint.com/check-apache-httpd-status-and-uptime-in-linux/) [Load Testing Web Servers with Siege Benchmarking Tool](https://www.tecmint.com/load-testing-web-servers-with-siege-benchmarking-tool/) ## Learn Linux Tricks & Tips [Easily Correct a Typo of Previous Command Using Carat (^) Symbol](https://www.tecmint.com/fix-correct-mistakes-typos-previous-command-in-linux/) [How to Use ‘cat’ and ‘tac’ Commands with Examples in Linux](https://www.tecmint.com/learn-linux-cat-command-and-tac-command/) [How To Assign Output of a Linux Command to a Variable](https://www.tecmint.com/assign-linux-command-output-to-variable/) [Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser](https://www.tecmint.com/creating-cdrom-iso-image-watch-user-activity-in-linux/) [3 Ways to Extract and Copy Files from ISO Image in Linux](https://www.tecmint.com/extract-files-from-iso-files-linux/) [How to View Configuration Files Without Comments in Linux](https://www.tecmint.com/view-files-without-comments-in-linux/) ## Best Linux Tools [7 Best Calendar Apps for Linux Desktop in 2024](https://www.tecmint.com/best-calendar-apps-linux-desktop/) [5 Best Open-Source Project Management Tools for Linux in 2024](https://www.tecmint.com/linux-project-management-tools/) [10 Top Open Source Caching Tools for Linux in 2024](https://www.tecmint.com/open-source-caching-tools-for-linux/) [7 Best Email Clients for Linux Systems](https://www.tecmint.com/best-email-clients-linux/) [6 Best Whiteboard Applications for Your Linux Systems](https://www.tecmint.com/linux-whiteboard-applications/) [5 Online Tools for Generating and Testing Cron Jobs for Linux](https://www.tecmint.com/online-cron-job-generator-and-tester-for-linux/) Privacy Manager Tecmint: Linux Howtos, Tutorials & Guides © 2026. All Rights Reserved. The material in this site cannot be republished either online or offline, without our permission. Hosting Sponsored by : [Linode Cloud Hosting](https://www.tecmint.com/go/linode) ✕ Pro TecMint Root Plan Premium Linux Education for Serious Learners ### Before You Go - Upgrade Your Linux Skills Root members get everything in one place, with new courses added every month. What You Get Ad-free access to all premium articles Access to all courses: Learn Linux, AI for Linux, Bash Scripting, Ubuntu Handbook, Golang and more. Linux certifications: RHCSA, RHCE, LFCS and LFCA Access new courses on release Weekly newsletter, priority support & Telegram community Join Root Today and Start Learning Linux the Right Way Structured courses, certification prep, and a community of Linux professionals - all in one membership. [Join Root Plan →](https://pro.tecmint.com/#/portal/signup) **\$8/mo** · or **\$59/yr** billed annually No thanks, I'll continue reading
Readable Markdown
***Brief: In this guide, we will discuss some useful examples of the screen command. By the end of this guide, users will be able to work with multiple shell sessions using a single Linux terminal window.*** As Linux users, we often need to work on long-running tasks, such as – downloading or [copying large files](https://www.tecmint.com/cp-command-examples/ "Copy Files and Directories in Linux"), executing time-consuming database queries, and so on. Sometimes these important tasks get terminated abruptly due to a session timeout. To mitigate such scenarios, we can use the **screen** command, which is a full-screen software program that can be used to multiplexes a physical console between several processes (typically interactive shells). It offers a user to open several separate terminal instances inside a single terminal window manager. The **screen** application is very useful if you are dealing with multiple programs from a command-line interface and for separating programs from the terminal shell. It also allows you to share your sessions with others users and detach/attach terminal sessions. In this guide, we will discuss how to install, configure, and use the **screen command** on a Linux system. Throughout this guide, we will understand the usage and benefits of the **screen command** using practical examples. Table of Contents - [Install Screen Command in Linux](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#Install_Screen_Command_in_Linux) - [Screen Command Syntax](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#Screen_Command_Syntax) - [1\. Start Screen for the First Time](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#1_Start_Screen_for_the_First_Time) - [2\. Show Screen Parameter](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#2_Show_Screen_Parameter) - [3\. How to List All Open Windows](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#3_How_to_List_All_Open_Windows) - [4\. How to Terminate Screen Window Session](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#4_How_to_Terminate_Screen_Window_Session) - [5\. How to Start a Screen Session with Name](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#5_How_to_Start_a_Screen_Session_with_Name) - [6\. Detach the Terminal Session with Screen](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#6_Detach_the_Terminal_Session_with_Screen) - [7\. Re-attach the Terminal Session with Screen](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#7_Re-attach_the_Terminal_Session_with_Screen) - [8\. Using Multiple Screen Terminal Windows](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#8_Using_Multiple_Screen_Terminal_Windows) - [9\. How to Rename a Screen Window](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#9_How_to_Rename_a_Screen_Window) - [10\. Switching Between Screen Terminal Windows](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#10_Switching_Between_Screen_Terminal_Windows) - [11\. How to Move to the Next Screen Window](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#11_How_to_Move_to_the_Next_Screen_Window) - [12\. How to Move to the Previous Screen Window](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#12_How_to_Move_to_the_Previous_Screen_Window) - [13\. How to Switch Between Current and Previous Window](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#13_How_to_Switch_Between_Current_and_Previous_Window) - [14\. How to Jump to a Particular Screen Window](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#14_How_to_Jump_to_a_Particular_Screen_Window) - [15\. How to Split a Screen Window Horizontally](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#15_How_to_Split_a_Screen_Window_Horizontally) - [16\. How to Split a Screen Window Vertically](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#16_How_to_Split_a_Screen_Window_Vertically) - [17\. Enable Screen Logging in Linux](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#17_Enable_Screen_Logging_in_Linux) - [18\. Lock Linux Terminal Screen](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#18_Lock_Linux_Terminal_Screen) - [19\. Add Password to Screen Session](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#19_Add_Password_to_Screen_Session) - [20\. Leaving Screen Terminal Session](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#20_Leaving_Screen_Terminal_Session) - [Screen Command Cheat Sheet](https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/#Screen_Command_Cheat_Sheet) So let’s get started. ### Install Screen Command in Linux On my **Ubuntu Server Edition**, the **screen** command has been installed by default. But, **Linux Mint** does not have a **screen** installed by default, so I need to install it first using the **[apt-get command](https://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/ "apt-get command examples")** before using it. Please follow your distribution installation procedure to install the screen. ``` $ sudo apt-get install screen [On Debian, Ubuntu and Mint] $ sudo yum install screen [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux] $ sudo emerge -a sys-apps/screen [On Gentoo Linux] $ sudo apk add screen [On Alpine Linux] $ sudo pacman -S screen [On Arch Linux] $ sudo zypper install screen [On OpenSUSE] ``` Now, let’s verify that the command has been installed successfully: ``` $ screen --version Screen version 4.8.00 (GNU) 05-Feb-20 ``` Actually, the **screen** is a very good terminal multiplexer program in Linux which is hidden inside hundreds of [Linux commands](https://www.tecmint.com/linux-commands-cheat-sheet/ "A – Z Linux Commands"). Let’s start to see the usage of the **screen** command in Linux with the following examples. ### Screen Command Syntax The syntax of the **screen** command is as follows ``` $ screen [OPTIONS] [ CMD [ ARGS ] ] ``` In the above syntax, we can see that all the parameters are options and they are represented by the square brackets `([])`. ### 1\. Start Screen for the First Time Just type the **screen** at the command prompt. Then the **screen** will show an interface exactly as the command prompt. ``` $ screen ``` ![Screen Terminal Program](https://www.tecmint.com/wp-content/uploads/2013/10/Screen-Terminal-Program.png) Screen Terminal Program ### 2\. Show Screen Parameter When you enter the **screen**, you can do all your work as you are in the normal command-line environment. But since the **screen** is an application, so it has commands or parameters. Type “**Ctrl-A**” and “**?**” without quotes. Then you will see all commands or parameters on the screen. ![Screen Terminal Key Bindings](https://www.tecmint.com/wp-content/uploads/2013/10/Screen-Terminal-Key-Bindings.png) Screen Terminal Key Bindings To get out of the help screen, you can press the “**space-bar**” button or “**Enter**“. (Please note that all shortcuts which use “**Ctrl-A**” are done without quotes). ### 3\. How to List All Open Windows In the previous example, we started a new shell session using the screen command. Now let’s use the `ctrl-a + "` key combination to list all open windows of the current screen session: ![List Screen Open Windows](https://www.tecmint.com/wp-content/uploads/2021/08/List-Screen-Open-Windows.png) List Screen Open Windows In the above output, we can see the number and name of the window. The first column represents the window number and it starts from zero. The next column represents the name of the window and its default format is `<user>@<hostname>:<working-directory>`. ### 4\. How to Terminate Screen Window Session We can terminate the active window session using the `ctrl-a + k` key combinations. It is important to note that, this action will interrupt the command execution from the current virtual window. ![Terminate Screen Window Session](https://www.tecmint.com/wp-content/uploads/2021/08/Terminate-Screen-Window-Session.png) Terminate Screen Window Session In the above output, we can see that the **screen** command is waiting for the user’s confirmation. It shows the warning message in the left bottom corner. Just like other Linux commands, we can use `'y'` to continue or `'n'` to abort the operation. ### 5\. How to Start a Screen Session with Name The **screen** command allows us to create a session with a user-defined name, which comes in handy when there are multiple sessions available. So, let’s use the `-S` option of the command to create a named session: ``` $ screen -S demo-screen ``` In the above command, the **demo-screen** is the name of the session. ### 6\. Detach the Terminal Session with Screen One of the advantages of a **screen** that is you can detach it. Then, you can restore it without losing anything you have done on the screen. Here’s the sample scenario: You are in the middle of **SSH** on your server. Let’s say that you are downloading a **400MB** patch for your system using the [wget command](https://www.tecmint.com/10-wget-command-examples-in-linux/ "Wget Command Examples"). **You might also like:** - [How to Secure and Harden OpenSSH Server](https://www.tecmint.com/secure-openssh-server/ "Secure and Harden OpenSSH Server") - [8 Most Popular SSH Clients for Linux](https://www.tecmint.com/ssh-clients-linux/ "SSH Clients for Linux") - [Basic SSH Command Usage and Configuration in Linux](https://www.tecmint.com/ssh-command-usage/ "Basic SSH Command Usage in Linux") - [5 Best Practices to Prevent SSH Brute-Force Login Attacks in Linux](https://www.tecmint.com/prevent-ssh-brute-force-login-attacks/ "Prevent SSH Brute-Force Login Attacks in Linux") The download process is estimated to take **2 hours** long. If you disconnect the **SSH** session, or suddenly the connection is lost by accident, then the download process will stop. You have to start from the beginning again. To avoid that, we can use a screen and detach it. Take a look at this command. First, you have to enter the screen. ``` $ screen ``` Then you can do the download process. For example on my **Linux Mint**, I am upgrading my **dpkg** package using the [apt command](https://www.tecmint.com/apt-advanced-package-command-examples-in-ubuntu/ "Ubuntu apt Command Examples"). ``` $ sudo apt install dpkg ``` Sample Output ``` Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: dpkg 1 upgraded, 0 newly installed, 0 to remove and 1146 not upgraded. Need to get 2,583 kB of archives. After this operation, 127 kB of additional disk space will be used. Get:1 http://debian.linuxmint.com/latest/ testing/main dpkg i386 1.16.10 [2,583 kB] 47% [1 dpkg 1,625 kB/2,583 kB 47%] 14,7 kB/s ``` While downloading in progress, you can press “`Ctrl-A`” and “`d`“. You will not see anything when you press those buttons. The output will be like this: ``` [detached from 5561.pts-0.mint] pungki@mint ~ $ ``` ### 7\. Re-attach the Terminal Session with Screen After you detach the screen, let’s say you are disconnecting your **SSH** session and going home. In your home, you start to **SSH** again to your server and you want to see the progress of your download process. To do that, you need to restore the screen. You can run this command: ``` pungki@mint ~ $ screen -r ``` And you will see that the process you left is still running. When you have more than **1 screen** session, you need to type the screen session **ID**. Use screen **\-ls** to see how many screens are available. ``` pungki@mint ~ $ screen -ls ``` Sample Output ``` pungki@mint ~ $ screen -ls There are screens on: 7849.pts-0.mint (10/06/2021 01:50:45 PM) (Detached) 5561.pts-0.mint (10/06/2021 11:12:05 AM) (Detached) 2 Sockets in /var/run/screen/S-pungki ``` If you want to restore screen **7849\.pts-0**.mint, then type this command. ``` pungki@mint ~ $ screen -r 7849 ``` ### 8\. Using Multiple Screen Terminal Windows When you need more than **1 screen** to do your job, is it possible? Yes, it is. You can run multiple screen windows at the same time. There are 2 (two) ways to do it. First, you can detach the first screen and run another screen on the real terminal. Second, you do a nested screen as shown. To create new windows, use the `ctrl-a + c` key combination two times to create two new windows. Next, let’s use the `ctrl-a + "` key combination to list all active windows: ![List Screen Active Windows](https://www.tecmint.com/wp-content/uploads/2021/08/List-Screen-Active-Windows.png) List Screen Active Windows In the above output, we can see that now there are three windows. ### 9\. How to Rename a Screen Window In the previous example, we created two new windows. However, their default names are not providing any details about them. In such cases, we can assign some meaningful names to them. We can use the `ctrl-a + A` key combination to rename the current window session. This key combination prompts a user to set a window title: ![Rename Screen Window Session](https://www.tecmint.com/wp-content/uploads/2021/08/Rename-Screen-Window-Session.png) Rename Screen Window Session ### 10\. Switching Between Screen Terminal Windows In the previous example, we created multiple windows. Now let’s see how to switch between them. First, let’s list all active windows using the `ctrl-a + "` key combination. Next, use the up or down arrow key to select the appropriate window. Finally, press the enter key to switch to the selected window. ![Switch Between Screen Windows](https://www.tecmint.com/wp-content/uploads/2021/08/Switch-Between-Screen-Windows.png) Switch Between Screen Windows In this example, we have selected the window with the title – **db-query**. ### 11\. How to Move to the Next Screen Window We can use the `ctrl-a + n` key combination to move to the next windows. Let’s understand this with an example. First, switch to the first window and verify it using the `ctrl-a + "` key combination: ![Switch to Screen Windows](https://www.tecmint.com/wp-content/uploads/2021/08/Switch-to-Screen-Windows.png) Switch to Screen Windows Now, let’s press the `ctrl-a + n` key combination two times to go to the third window and use the `ctrl-a + "` key combination to verify the same. ![Switching Screen Windows](https://www.tecmint.com/wp-content/uploads/2021/08/Switching-Screen-Windows.png) Switching Screen Windows In the above output, we can see now we are on the third window. ### 12\. How to Move to the Previous Screen Window In a similar way, we can use the `ctrl-a + p` combination to switch to the previous window. Currently, we are on the third window. So, let’s use the `ctrl-a + p` key combination two times and verify that we are on the first window again: ![Switch to Previous Screen Window](https://www.tecmint.com/wp-content/uploads/2021/08/Switch-to-Previous-Screen-Windows.png) Switch to the Previous Screen Window In the above output, we can see that now we came back to the first window. ### 13\. How to Switch Between Current and Previous Window Sometimes, we just want to switch between two windows. In such cases, we can use the `ctrl-a + ctrl-a` key combination. To understand this, first switch to the first window: ![Switch to First Screen Window](https://www.tecmint.com/wp-content/uploads/2021/08/Switch-to-First-Screen-Window.png) Switch to First Screen Window Next, switch to the last window: ![Move to Last Screen Window](https://www.tecmint.com/wp-content/uploads/2021/08/Move-to-Last-Screen-Window.png) Move to the Last Screen Window Finally, use the `ctrl-a + ctrl-a` key combination to jump to the first window again. ### 14\. How to Jump to a Particular Screen Window In the previous examples, we saw various ways to switch between windows. However, sometimes we want to jump to a particular window. In such scenarios, we can use the window numbers. First, let’s use the `ctrl-a + "` key combination to find the window number: ![List Screen Window Numbers](https://www.tecmint.com/wp-content/uploads/2021/08/List-Screen-Window-Numbers.png) List Screen Window Numbers In the above output, the first column represents the window number. It is important to note that, the screen command starts numbering from zero. Now, let’s use the `ctrl-a + 2` key combination to jump to the third window and verify that we are in the correct window: ![Jump to Particular Screen Window](https://www.tecmint.com/wp-content/uploads/2021/08/Jump-to-Particular-Screen-Window.png) Jump to a Particular Screen Window ### 15\. How to Split a Screen Window Horizontally Just like normal terminals, we can also split the screen window. We can use the `ctrl-a + S` key combination to split the window horizontally. ![Split Screen Window Horizontally](https://www.tecmint.com/wp-content/uploads/2021/08/Split-Screen-Window-Horizontally.png) Split Screen Window Horizontally Now, we can use the `ctrl-a + tab` key combination to jump between the regions. Lastly, we can use the `ctrl-a + X` key combination to remove the current region. It is important to note that here we have to use an uppercase X character. ### 16\. How to Split a Screen Window Vertically Similarly, we can use the `ctrl-a + |` key combination to split the current window vertically: ![Split Screen Window Vertically](https://www.tecmint.com/wp-content/uploads/2021/08/Split-Screen-Window-Vertically.png) Split Screen Window Vertically In addition to this, we can also use the `ctrl-a + tab` key combination switch between the regions and the `ctrl-a + X` key combination to close the current region. ### 17\. Enable Screen Logging in Linux Sometimes it is important to **record** what you have done while you are in the console. Let’s say you are a **Linux Administrator** who manages a lot of Linux servers. With this **screen** logging, you don’t need to write down every single command that you have done. To activate the screen logging function, just press “`Ctrl-A`” and “`H`“. (Please be careful, we use a capital ‘`H`’ letters. Using non-capital ‘`h`’, will only create a screenshot of the screen in another file named hardcopy). At the bottom left of the screen, there will be a notification that tells you to like: Creating logfile “**screenlog.0**“. You will find a **screenlog.0** file in your home directory. This feature will append everything you do while you are in the screen window. To close the screen to log running activity, press “`Ctrl-A`” and “`H`” again. Another way to activate the logging feature, you can add the parameter “`-L`” when the first time running the screen. The command will be like this. ``` pungki@mint ~ $ screen -L ``` ### 18\. Lock Linux Terminal Screen The screen also has a shortcut to **lock** the screen. You can press the “`Ctrl-A`” and “`x`” shortcuts to lock the screen. This is handy if you want to lock your screen quickly. Here’s a sample output of the lock screen after you press the shortcut. ``` Screen used by Pungki Arianto on mint. Password: ``` You can use your Linux password to unlock it. ### 19\. Add Password to Screen Session For security reasons, you may want to put the **password** to your screen session. A Password will be asked whenever you want to **re-attach** the screen. This password is different from the **Lock Screen** mechanism above. To make your screen password protected, you can edit the “**\$HOME/.screenrc**” file. If the file doesn’t exist, you can create it manually. The syntax will be like this. ``` password crypt_password ``` To create the “**crypt\_password**” above, you can use the “**mkpasswd**” command on Linux. Here’s the command with the password “**pungki123**“. ``` pungki@mint ~ $ mkpasswd pungki123 l2BIBzvIeQNOs ``` **mkpasswd** will generate a hash password as shown above. Once you get the hash password, you can copy it into your “**.screenrc**” file and save it. So the “**.screenrc**” file will be like this. ``` password l2BIBzvIeQNOs ``` Next time you run the screen and detach it, a password will be asked when you try to **re-attach** it, as shown below: ``` pungki@mint ~ $ screen -r 5741 Screen password: ``` Type your password, which is “**pungki123**” and the screen will **re-attach** again. After you implement this screen password and press “`Ctrl-A`” and “`x`“, then the output will be like this. ``` Screen used by Pungki Arianto on mint. Password: Screen password: ``` A Password will be asked to you **twice**. The first password is your **Linux password**, and the second password is the password that you put in your **.screenrc** file. ### 20\. Leaving Screen Terminal Session There are **2** (two) ways to leave the screen. First, we are using “`Ctrl-A`” and “`d`” to detach the screen. Second, we can use the exit command to terminate the screen. You also can use “`Ctrl-A`” and “`K`” to kill the screen. ### Screen Command Cheat Sheet | **Command** | **Description** | |---|---| | `screen -S <session_name>` | Start a new session with session name. | | `screen -ls` | List running sessions / screens. | | `screen -x` | Attach to a running session. | | `screen -r <session_name>` | Attach to a running session with name. | | `screen -d <session_name>` | Detach a running session. | | `Ctrl-a c` | Create new window. | | `Ctrl-a Ctrl-a` | Change to last-visited active window. | | `Ctrl-a <number>` | Change to window by number. | | `Ctrl-a ' <number or title>` | Change to window by number or name. | | `Ctrl-a n or Ctrl-a <space>` | Change to next window in list. | | `Ctrl-a p or Ctrl-a <backspace>` | Change to previous window in list. | | `Ctrl-a "` | See window list. | | `Ctrl-a w` | Show window bar. | | `Ctrl-a k` | Kill current window. | | `Ctrl-a \` | Kill all windows. | | `Ctrl-a A` | Rename current window. | | `Ctrl-a S` | Split display horizontally. | | `Ctrl-a | or Ctrl-a V` | Split display vertically. | | `Ctrl-a tab` | Jump to next display region. | | `Ctrl-a X` | Remove current region. | | `Ctrl-a Q` | Remove all regions but the current one. | | `Ctrl-a H` | Enable logging in the screen session. | | `Ctrl-a x` | Lock (password protect) display. | That’s some of the **screen** command usage on daily basis. There are still a lot of features inside the **screen command**. You may see the **screen man page** for more detail. ***Do you know of any other best example of the screen command in Linux? Let us know your views in the comments below.***
Shard69 (laksa)
Root Hash17998126746619863669
Unparsed URLcom,tecmint!www,/screen-command-examples-to-manage-linux-terminals/ s443