Simple tmux tutorial

Source: Internet
Author: User

Simple tmux tutorial

Remote access to a machine or local terminal often finds that a terminal is far from enough and needs to be opened at the same time. It is often hoped that these windows will be displayed in sight at the same time. Tmux is born for this demand.

As shown in, does it look very convenient? ^-^.

The following are the commands frequently used by the author in his daily work. In fact, there are many other commands, but they are not used here. If you are interested, refer to the official tutorials.

By default, all built-in commands of tmux need to be Ctrl + B, and then type the corresponding command

Ctrl + B "-split pane horizontally
Ctrl + B %-vertically divide the current pane
Ctrl + B arrow keys-switch between panes
Ctrl + B, and do not release Ctrl, direction key-adjust the pane size
Ctrl + B c-(c) reate to generate a new window
Ctrl + B n-(n) ext move to the next window
Ctrl + B p-(p) revious move to the previous window.
Ctrl + B Space key-use the next built-in Layout
Ctrl + B q-display Number of the separated window
Ctrl + B o-jump to the next separation window
Ctrl + B &-confirm and exit tmux

These commands have been tried several times, and the tool is basically ready for use. Simplicity is the most important thing.

By the way, the usage of a "advanced" point is as follows:

I often get into tmux and will get used to generating several more panes, like the layout in the figure above, one on the left and one on the right. Is it very troublesome to input commands like this every time you enter tmux? Is there a way to automatically generate the above layout as soon as tmux is entered? The answer is yes. There should be more than one method. The following provides a method selected by the author:

First, write a script to create each pane.

~ /. Tmux/mylayout

Selectp-t 0 # select the 0th panes
Splitw-h-p 50 # divide it into two
Selectp-t 1 # select the first one, that is, the one on the right.
Splitw-v-p 50 # divide it into the upper and lower layers, which turns it into the layout in the figure.
Selectp-t 0 # select the first one

Add a sentence after. tmux. conf.

Bind D source-file ~ /. Tmux/mylayout

After entering the tmux, press Ctrl + B D (D is in upper case, press shrift, you can also press it into other characters, the mylayout script is automatically executed to generate the graphic layout. If the. tmux. conf file does not exist, generate it by yourself. Note that there is a. (point)


There are also some minor functions. You can simply add the corresponding commands in. tmux. conf to open the corresponding functions:

You can select the set-option-g mouse-select-pane on pane.

The mouse wheel can be set-window-option-g mode-mouse on.

Tmux 1.8 released, a Linux terminal multiplexing

Tmux: terminal multiplexing

Tmux details: click here
Tmux: click here

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.