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

How to install and use the Linux window manager Tmux

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "Linux window management program Tmux how to install and use", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let Xiaobian take you to learn "Linux window management program Tmux how to install and use"!

introduced

tmux is a window management program in linux, different from iTerm2, which provides a Session storage and recovery function at any time (the concept of Session will be described later), detach Session(keep Session running in the background), and then re-attach Session.

Common scenarios, in the company Terimal opened multiple tags and files, home from work suddenly inspired to continue writing, using ssh remote link company computer, and then found that the tag pages and files have to be reopened, if you use Tmux, after work detach the current Session, home ssh remote connection, attach Session, scene recovery and happy to continue programming

Install #Install missing packages under Mac OS X Manage Homebrew$ ruby -e "$(curl -fsSL https://raw.githuusercontent.com/Homebrew/install/master/install)"#Install artifact Tmux$ brew install tmux base #Start Tmux$ tmux#Close Tmux$ ctrl + d #or exit $ exit

tmux has three basic concepts: Session, Window and Panel. When you type tmux, what tmux actually does is first create a Session, and then create a window within that Session, and you can continue to create multiple Windows, each window initially containing only one panel, and then continue to split the screen, and multiple Panels appear. The terminals you see in them actually belong to one panel of tmux.

Further, a Session can contain multiple windows, and each Window can contain multiple panes.

basic operation

How to execute all shortcuts:

Press control + b, then release control + b(to tell Tmux I'm going to use the shortcut key for Tmux), then press the shortcut key again to trigger various actions.

For example: C-B ? press control + b, then release control + b, then press control + b again. key, a list of all shortcut keys is displayed.

C-b ? List all shortcut keys, press q or Esc to return

C-b d detach current session, temporarily return to Shell interface, enter tmux attach to re-enter previous session

C-b s Select and switch sessions; used when multiple sessions are open simultaneously

Shortcuts Window operations

C-b c Create a new window

C-b & Close current window

C-b w List all window selections

C-b p Switch to previous window

C-b n Switch to the next window

C-b window number Switch windows using window number (e.g. C-b 1 if window number is 1)

C-b , rename the current window to identify each window

Pane operation

C-b % horizontal terminal

C-b "vertical terminal

The C-b arrow keys will be free to select each panel

C-b x Close current pane

C-b q Display panel number

Session operation #Create a new session$ tmux new -s #Create a new Session in the current session, and ensure that the previous session still exists # C-b : Then enter the following command new -s #to enter the session named test $ tmux attach -t test

C-b s List all sessions

C-b d detach current session(can be considered background running)

Advanced Beautification Tmux

Beautification using the Tmux configuration of gpakosz.

advantages

It is easier to use C-a as a prefix, while preserving the trigger prefix of C-b.

powerline status bar beautification (used vim should be familiar)

Display notebook battery status

installation and use

$ cd$ rm -rf .tmux$ git clone https://github.com/gpakosz/.tmux.git$ ln -s .tmux/.tmux.conf$ cp .tmux/.tmux.conf.local . At this point, I believe that we have a deeper understanding of "Linux window management program Tmux how to install and use," may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to 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