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 terminal extension tools of Ubuntu

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly explains "what are the terminal extension tools of Ubuntu". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what are the terminal extension tools of Ubuntu.

1 install Terminator

The code is as follows:

Sudo apt-get install terminator

2 use

Open Termintor and press Ctrl-E (note that big E is to press and hold Shift) to split the terminal Ctrl-O vertically, but hold down Alt and then press up and down to switch between Ctrl-D in different split windows and close the split window.

2.1 configuration

The font and color of terminator can be configured through this configuration file in ~ / .config/terminator/config

The code is as follows:

Font = Monaco 10 # set font

Background_color = "# 204070" # background color

Foreground_color = "# F0F0F0" # font color

Cursor_blink = True # set the cursor

Scrollbar_position = disabled # disable scroll bar

Titlebars = no # disable the title bar

Background_darkness = 0.4

Background_type = transparent # background type can be set to picture

More configuration can be found in the configuration file:

The code is as follows:

Man terminator_config

3 Guake

Guake is a drop-down terminal program in the gnome desktop environment, so you only need to press F12 to call it, and then press it again to hide it. Guake supports keyboard shortcuts, labels, background transparency, and so on.

3.1 install Guake

The code is as follows:

Sudo apt-get install guake

3.2Using Guake

After enabling guake, you can press F12 to bring it up. Cool shortcut keys are the same as gnome terminal.

Ctrl-T New label

F2 rename label

A tag on Ctrl-PageUp

Ctrl-PageDwon next label

F11 full screen

F12 hide / Show

4.Tmux: window manager for shell

Using a window manager in a text mode environment-it sounds a little weird, doesn't it? However, you should remember when Web browsers first implemented paging browsing, right? At the time, this was a major improvement in usability, reducing the clutter and numerous window lists of the desktop taskbar. For your browser, you only need a button to switch to each individual site you open in the browser, instead of having a taskbar or navigation icon for each site. This feature is very meaningful.

If you sometimes run several virtual terminals at the same time, you will encounter a similar situation; jumping between them, or finding the terminal you need every time in the taskbar or window list, can be troublesome. Having a window manager in text mode not only allows you to run multiple shell sessions as if you were running in the same terminal window, but you can even arrange these windows together.

In addition, this has another benefit: these windows can be separated and reconnected. The best way to see how this works is to try it yourself. In a terminal window, type screen (in most distributions, it is installed by default or can be found in the package repository). Some welcome words will appear-just press the Enter key and they will disappear. Now run an interactive text mode program, such as nano, and close the terminal window.

In a normal shell conversation, closing the window will terminate all processes running on the terminal-so the Nano editing session is terminated, but this is not the case for screen. Open a new terminal and enter the following command:

The code is as follows:

Screen-r

Look, the Nano session you just opened is back!

When you run screen just now, it creates a new independent shell session that is not bound to a particular terminal window, so it can be detached and reconnected later (that is, the-r option).

This is especially useful when you are using SSH to connect to another machine and do some work, but you don't want to be affected by a fragile connection. If you are doing something in a screen session and your connection is suddenly disconnected (or your laptop is dead, or your computer is dead-- it's not that sad), all you have to do is reconnect or recharge your computer or buy a new computer, then run screen-r to reconnect to the remote computer and start where you just disconnected.

Right now, we've all been talking about GNU's screen, but the title of this section mentions tmux. In essence, tmux (terminal multiplexer) is like an advanced version of screen, with a lot of useful extra features, so now we're starting to focus on tmux. Some distributions include tmux; by default. On other distributions, it usually requires only an apt-get, yum install, or pacman-S command to install it.

Once you have installed it, type tmux to start it. Then you will notice that there is a green information bar at the bottom of the terminal window, which is very similar to the taskbar in a traditional window manager: it displays a list of running programs, the hostname of the machine, the current time and date. Now run a program, also take Nano as an example, click Ctrl+B and then press C, which will create a new window in the tmux session, and you can see the following information in the taskbar at the bottom of the terminal:

The code is as follows:

0Monoon-1VOBASH *

Each window has a number, and the currently rendered program is marked with an asterisk. Ctrl+B is the standard way to interact with tmux, so if you hit the key combination with a window serial number, it will switch to the corresponding window. You can also use Ctrl+B plus N or P to switch to the next or previous window respectively-or use Ctrl+B plus L to switch between the two most recently used windows (somewhat similar to the classic Alt+Tab key combination on the desktop). If you need to know the list of windows, use Ctrl+B plus W.

So far, everything is fine: now you can run multiple programs in a single terminal window to avoid confusion (especially if you often maintain multiple SSH connections to the same remote host). What should I do when I want to see two programs at the same time?

In this case, you can use the panes in tmux. Click Ctrl+B plus%, and the current window will be divided into two parts: one on the left and one on the right. You can use Ctrl+B plus O to switch between the two parts. This is especially useful when you want to see two things at the same time-for example, one pane looks at the instruction manual, and the other pane looks at a configuration file with an editor.

Sometimes you want to zoom a single pane, which requires some skill. First you need to tap Ctrl+B and add: (colon), which will make the tmux bar at the bottom turn dark orange. Now you are in command mode, where you can enter commands to operate tmux. Enter resize-pane-R to move the current pane one character to the right, or use-L to move to the left. These commands may seem long for a simple operation, but note that in tmux's command mode (which starts with a semicolon mentioned earlier), you can use the Tab key to complete the command. It is also important to mention that tmux also has a command history, so if you want to repeat the zoom operation, you can first click Ctrl+B and then follow a semicolon, and use the up arrow to retrieve the command you just entered.

Finally, let's take a look at detach and reconnect-the features of screen that we just introduced. In tmux, click Ctrl+B plus D to detach the current tmux session from the current terminal window. This allows all the work of the session to run in the background, and you can reconnect to the session using tmux a. But what if you have multiple tmux sessions running at the same time? We can list them using the following command:

The code is as follows:

Tmux ls

This command will assign a serial number to each session; if you want to reconnect to session 1, you can use tmux a-t 1. tmux is highly customizable, you can customize key bindings and change the color scheme, so once you have adapted to its main functions, please delve into the instruction manual to learn more.

In the figure above, tmux opens two panes: on the left is Vim editing a configuration file, and on the right is the guide man page.

At this point, I believe you have a deeper understanding of "what are the terminal extension tools of Ubuntu?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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