Screen Commands in Linux

Screen commands provides easy manner and security when work with CLI Console. Screen commands have following advantages;

  • You can continue from where you left your transaction after any disconnection.
  • It is possible to seperate your own work when working with other users simultaneously on the same system and able to follow your own work later. 
  • Speed up and facilitate your work by dividing the screen into multiple parts.

Using these commands will increase the productivity and facilitate your work.

When you login via remote (console) connection and then have root credentials, you can use commands as follows:

1. Opening a new screen is important to avoid losing your work in case of any disconnection. Thus, it is recommended that opening a new screen for every work.

To open a new screen just write screen command:1.png

Now you have opened your screen to work. If you want to display your screen later, use screen -x command.

If there are multiple opened screen, it is possible to see these screen list via screen -x command. You can access your screen with its id through finding the date and time of the screen.

2.png

In the example above, let our screen is 24774.pts-17.customer which we will connect. To re-connect to this screen, we can use screen -x 24774 command. The id of both screen starts with 2 and the following number is different. Thus we can connect to same screen with screen -x 24 command.

Sometimes it will not be easy to find your own screen with this method. Therefore, it is easy to give a name to the screen that you have opened it. With -S screen-name command you can assign any name to your screen  and then   reconnect with screen -x screen-name command.

3.png 4.png

2. It is possible to open new screen in a screen with Ctrl+a and buttons. Ctrl a and Space buttons are used to switch other screens that opened in a screen. While visiting among these screens Ctrl+a, a combination is used to quick return to previous screen.  

3. To divide the screen horizontally on the display Ctrl+a, Shift+s combination is used and so we can work with two different screens on the same display.

5.png

If we want to make transition between two screens, Tab button is sufficient. While switching the screens if there is an opened screen previously, you can find this screen through pressing Ctrl+a, Space buttons and you can work on this screen. If a different screen is not opened yet, you need to switch to bottom screen and open a new screen via Ctrl+a, c combination. 

4. To split the screen vertically Ctrl+a, | combination is used.6.png

Note : You can split screens vertically or horizontally into multiple screens via Ctrl+a, Tab combination.  

7.png

Note : To remove a divided screen Ctrl+a, Shift+x combination is used.

5. Exit command is used to remove any screen or Ctrl+d key combination will do same job. 

Note : If you want to exit from the screens that you have opened and given name, you can use Ctrl+a, d key combination. Later, it is possible to work again with these screens via screen -x screen_name command. 

To sum up;

Combination                            Instruction

  • Ctrl+a, c                           It creates a new screen within the screen.
  • Ctrl+a, Space                  It provides transition between the opened screens.
  • Ctrl+a, a                           It provides switch to previous screen.
  • Ctrl+a, d                           Exit from the screen without closing it.
  • Ctrl+a, Shift+x                Screen is divided horizontally.
  • Ctrl+a, |                           Screen is divided vertically.
  • Ctrl+a, Tab                      It provides transition among the divided screens.
  • Ctrl+a, Shift+x                It closes the one part of the screen divided. 
Was this article helpful?
0 out of 0 found this helpful

Articles in this section

Become a Certified Logsign User/Administrator
Sign-up for Logsign Academy and take the courses to learn about Logsign USO Platform in detail. Enjoy the courses, and get your badges and certificates. In these courses, you'll learn how to use Logsign in your work and add value to your career.
Visit Our Blog
Our Logsign USO Platform illustrate our expertise. So do the blog. Through our blog posts, deepen your knowledge on various SecOps topics or get updated about important news & modern approaches for cybersecurity. Get into the habit of reading valuable information provided by Logsign. Be a step ahead.