Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the skills of using GNU Screen?

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "GNU Screen has what skills to use", the explanation content in the article is simple and clear, easy to learn and understand, please follow the small series of ideas slowly in-depth, together to study and learn "GNU Screen has what skills to use" bar!

Learn basic GNU Screen terminal reuse techniques and download our terminal command memo so you can familiarize yourself with commonly used shortcuts.

For the average user, command line terminal windows can be confusing and mysterious. But as you learn more about Linux terminals, you quickly realize how efficient and powerful they are. However, it doesn't take long for you to want to make your terminal more efficient. Besides putting more terminals on your terminal, what good way can you improve your terminal efficiency?

terminal multiplexing

One of the many advantages of the terminal is that it is a centrally controlled interface. It's a window that gives you access to hundreds of apps, and all you need to interact with each one is a keyboard. However, modern computers almost always have excess processing power, and modern computer experts like to multitask, resulting in a window of processing hundreds of applications is quite limited.

A common answer to this problem is terminal multiplexing: the ability to stack virtual terminals together and then move between them. With terminal multiplexers, you keep centralized control, but when you multitask, you can switch terminals. Better yet, you can split the screen in the terminal so that multiple screen windows are displayed at the same time.

Select the appropriate multiplexer

Some terminals offer similar functionality, with tabbed interfaces and split views, but with subtle differences. First of all, the functionality of these terminals relies on graphical desktop environments. Second, many graphical terminal functions require mouse interaction or inconvenient keyboard shortcuts. Terminal Multiplexer functionality works just as well on text consoles as on graphical desktops, and key bindings are conveniently designed for common terminal sequences.

There are two popular multiplexers: tmux and GNU Screen. Although you interact with them in slightly different ways, they do the same things and mostly have the same functions. This article is a starter guide to GNU Screen. For more on tmux, read Kevin Sonney's tmux introduction.

Using GNU Screen

The basic usage of GNU Screen is simple. Start it with the screen command and you will enter window 0 of your Screen session. Until you decide that you need a new terminal prompt, you may not notice the change.

When a terminal window is occupied by an activity (e.g., you launch a text editor like Vim or Jove, or you are working on audio or video, or running a batch task), you can create a new window. To open a new window, press Ctrl+A, release, and then press C. This will create a new window on top of your existing one.

You will know that you are currently in a new window because your terminal seems to have nothing but default prompts. Of course, your other terminal still exists, it just hides behind the new window. To traverse open windows, press Ctrl+A, release, and then press n (for next) or p (for previous). In the case of only two windows open, n and p function the same, but you can open more windows at any time (Ctrl+A, then c) and switch between them.

split screen

The default behavior of GNU Screen is more like a mobile screen than a desktop: you can only see one window at a time. If you use GNU Screen because you like to multitask, focusing on just one window may seem like a step backwards. Fortunately, GNU Screen allows you to divide your terminal into windows within windows.

To create a split horizontal window, press Ctrl+A, and then press s. This places one window above another, just like a pane. However, partitioned space is useless until you tell it what to display. So, after creating a split window, you can use Ctrl+A and Tab to move to the split window. Once inside, use Ctrl+A and n to browse through all available windows until the content you want to display appears in the split pane.

You can also press Ctrl+A and press| (This is a pipe character that creates a vertical split window by pressing the shift key plus\on most keyboards.)

Custom GNU Screen

GNU Screen uses Ctrl+ A-based shortcuts. Depending on your habits, this may feel very natural to you, or it may be very inconvenient because you may use Ctrl+A to move to the beginning of a line. In any case, GNU Screen allows a variety of customizations via the.screenrc configuration file. You can use this to change trigger key bindings (called "escape" key bindings).

escape ^jJ

You can also add a status line to help you keep yourself from getting lost in Screen sessions.

# status bar, with current window highlightedhardstatus alwayslastlinehardstatus string '%{= kG}[%{G}%H%? %1`%?% {g}][%= %{= kw}%-w%{+b yk} %n*%t%? (%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]' # enable 256 colorsattrcolor b ".I"termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'defbce on

In conversations where multiple windows are open, an alert that constantly alerts which windows have focus activity and which windows have background activity is particularly useful. It is similar to a terminal task manager.

Download Memo Sheet

As you learn how to use GNU Screen, there are many new keyboard commands to remember. Some commands you remember immediately, but those you don't use often may be harder to remember. You can press Ctrl+A and then press? To access the GNU Screen help interface, but if you prefer something that can be printed and placed next to your keyboard, download our GNU Screen cheat sheet.

Thank you for reading, the above is the content of "GNU Screen what skills to use", after learning this article, I believe that everyone has a deeper understanding of GNU Screen what skills to use this issue, the specific use of the situation still needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report