Home » today » Technology » Boosting Productivity with tmux: A Magic Tool for Linux Developers

Boosting Productivity with tmux: A Magic Tool for Linux Developers

Image Source…

Developers who are familiar with using the Linux series are most often in contact with the Terminal terminal, and how to use the Terminal terminal efficiently? Here is a recommendation of a magic weapon”tmux“, he can turn on our multitasking mode, and quickly move around in various windows to type program commands to speed up work efficiency.

And there is a Server running behind it. When we execute programs for large-scale tasks or AI training, the model training will not fail due to disconnection caused by remote connections.tmuxHelp us reduce this risk, and we who are pursuing efficiency may wish to give it a try.

Install

description file: https://github.com/tmux/tmux/wiki/Installing

Take Ubuntu as an example

sudo apt install tmux

architecture

Session: It is a container of Windows, and a Session can contain multiple Windows. Window: It is the container of Pane. A Window can contain multiple Panes. Pane means pane, that is, a window can be divided into many panes. Pane: Each Pane can execute instructions, display results, etc., which is the smallest unit of our operation.

Image Source…

It’s hard to understand just by looking at the architecture, but it doesn’t matter. Below we will explain step by step what the nouns corresponding to each function are and how to operate them.

Open a Session

tmux new -s test

After successful opening, it will be attached to the session, and the easiest way to identify it is the green bar at the bottom.

Image Source…

Then add Window to the Session

Use the shortcut key “Ctrl + c” to add a Window.

Image Source…

This means that the Session has two Windos, how to switch? Very simple, we can use shortcut keys.

# Next Window
Ctrl + N

# Previous Window
Ctrl + P

How to control multiple Panes under one Windows

Let’s first use the horizontal split “Ctrl + b + “” to demonstrate. In the same Window, cut up and down into two Panes, so that we can type commands back and forth between different Panels, such as watching LOG while executing program…

Image Source…

For more commands related to operating Pane: https://github.com/tmux/tmux/wiki/Getting-Started

epilogue

For efficiency-oriented engineers, this is a very useful tool library, we might as well learn it, but in addition to engineers, if you are also a Linux and Mac user, this set of tools is also very helpful , Sometimes command terminals without UI can speed up our efficiency in processing files. We in the digital age should all learn.

If you like to write articles, you may wish to find out:

An exclusive win-win platform for creators and readers in the era of Web3.0—why join?

Welcome to join us to practice writing and earn knowledge

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.