Remote management tool-tmux under Linux

Source: Internet
Author: User

Remote management tool-tmux under Linux

1. Control keys

The        Control key is the primary key of the Tmux. When you press this button in the TMUX environment, TMUX will parse the command you entered later into its built-in function. Tmux The default control key is Ctrl+b (press CTRL and B at the same time) , followed by a lowercase c-b instead). This is equivalent to screen of the CTRL + A. People who have used two tools always argue about the rationality of Ctrl + A and ctrl+b. The argument is that Emacs and VI are the arguments. I don't understand that. These two people only use the editor, do not have instructions? Because they don't seem to know in bash environment: CTRL + a jumps to the start of the command, and Ctrl+b represents a cell back. From this point of view, I think the use of c-b is not bad. Because you press C-b, the functionality in the bash environment remains valid:)       2. Get shortcut help        not mentioned earlier, here is to point out that when you press C-b, I hope you have entered the "Tmux environment". The method of entry is simple. Enter directly on the command line: Tmux. No, install it. Fortunately, the ubuntu9.10 has integrated the tmux. Although not the latest version, but eliminates the hassle of compiling:) Now press C-b?       What's next, This is what is listed here, some of the most useful things. To view the above or below, direct Pageup,pagedown can be:) exit please press Q (this test is not good, almost with tmux interaction, can use this exit)       3. Common Shortcuts       c-b C Create a new window        When you are regretting that the current window is occupied by an instruction, This shortcut will solve the pressing challenge. The current window appears in the taskbar *       For example, the window that is now in action is 3       c-b n switches to the next window        C-B p switch to previous window       c-b l The last window, and the concept of the previous window is not the same yo, who tried to know        C-bW Select the open session in the current window by using the up and down keys       c-b numbers jump directly to the window of the number you are pressing       c-b & exiting the current window (personally, I don't think it's much use Because I am accustomed to c-d quit bash. Of course, if you make sure that no other window has a useful program running, try this command is also good)       c-b D temporary Disconnect session after disconnecting, you can also connect yo:)        4. split window       vim, you can directly:! command to execute the command, or read the result of the command directly to the current editor. Many times we have a need, Take a look at the results of the last execution instead of switching. Initially see the official website pictures can, horizontal points, can be vertical points, pretty cool. But now I also do not know how to Jinzhao:)       c-b "split out a window       c-b o switch in a small window This method can only be switched once, and then C-b O, suitable for two windows. If you split a lot of small windows in the current window, you need to use the following two instructions .       c-b (arrow keys) on the previous window       c-b (direction key) next window   to point out, press once c-b, you can choose up and down, until you choose the window you want , this is not the same as C-b o .      c-b! Close all small Windows       c-b x Close the small window at the current cursor       5. Switch to another session        The above mentioned is the concept of Windows, is to create multiple windows in a single session, in a window to create a number of small windows. And now that's the concept of conversation. You will create a new session every time you execute Tmux, C-b D will be saved to quit a session .      c-b S Select attach session        Watch out, unlike the display       6. Modify the current window name       TMUX allows you to specify different names for different Windows        C-b, modify the current window name        Change the name of the window to Rainbird?      7. Show a clock        In fact, simple when there is no big use, is a screensaver function, but you can set the configuration file, so that from the clock to enter the time to exit the password:)       c-b t clock       8. View history        This is a feature that has plagued the author for a long time, as some commands execute, and the result is always more than one screen, and I don't know how to page up to see the front of things, Until later only inadvertently discovered is with:      c-b pageup/pagedown       Exit, of course, still use Q       9. Copy and paste:       Copy things are not very obvious when using GNOME terminal, because you can scroll up and down by the mouse, you can select things by left, right-click Copy or paste. Just take this out, To illustrate a kind of speculation and an efficient mobile habit. When looking at Tmux help, the author notes that there is said after C-b, through [into the replication mode. But what about coming in? The interface looks like the previous history. It's been a long time since the study, if you want to use this feature, you need to know C-b: You can enter the Tmux command mode, and then you can set some instructions. For example, modify the mode key SETW Mode-keys VI. So you change the current mode to VI. And then into copy mode (C-b [) is it possible to move up and down through j,k in the word character like in Vim?        By looking at Help, vi and Emacs pattern comparison            Function               VI          emacs       &NBSP ;   Start of line           0 or ^      C-a         &N Bsp Clear selection         Escape      C-g           Copy SE Lection          enter       m-w           Cursor do WN             J           down         &N Bsp End of line             $           c-e       & nbsp   Cursor left             h           left           Next page               c-f         page down& nbsp;&nbsp         Next word               &nbsp        . ; m-f           Previous page           c-u       &NBS P Page up           Previous word           B       &N Bsp   m-b           Quit mode               Q   &NB Sp       escape           Cursor right             L           right           Start selection       &N Bsp Space       c-space           Cursor up           &N Bsp   K           up       What did you find? We used page up and page down to page up and down, and we can use the up and down keys. Yes, No.Is that the pattern we used before is Emacs? Because if we use ctrl+space to choose things, we will never succeed, because the system first preemption, because these two keys are defined to switch input method. So, if you want to use the keyboard copy function, You'd better change the mode to VI first, and then choose the keys supported by the VI. The space is the starting point of the selection, then move up or down or left or right to the end, enter, the content is copied. One of the benefits is that you can copy to something that is not on the current screen!             10. Common parameters        Finally say a few parameters commonly used by Tmux itself:)        TMUX LS lists existing sessions (List-sessions)       tmux a connected to this previously disconnected session (Attach-session) By default, the session that lists the smallest number of IDs is connected, and you can specify which session you want to connect to: Tmux a-t one connection to the first session       TMUX New Create a session (New-window) of course, The new session is created without this parameter:)        about Tmux the end is here. Tmux is a sharp weapon, and this weapon is also a razor in your hand depending on how much you spend on it. Some of the above tips, You will only have some basic instructions, you can greatly improve work efficiency, what are you waiting for? Hurry up and move on:)

Remote management tool under Linux-tmux

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.