The day before yesterday to open the blog Park, saw an article about Tmux Tmux-linux practitioners must be a tool, deliberately also point in to see. After all, Linux is very familiar to me as a game server developer. But I glanced at it briefly and turned it off. It was not until the next day 码农周刊
that this article was recommended that I really paid attention to it. tmux
is it really that useful? So I daoteng it myself, and it's really useful in many scenarios. Such as:
- Do the server, must pay attention to performance, and Tmux multiple pane can be very convenient at the same time to focus on a number of performance indicators;
- There are just a few services available in our game suits, and it is really convenient to see multiple consoles at the same time when you are tuning multiple services.
The above is not other ways not, for example, I use Xshell, while watching multiple Xshell can achieve the same effect. But the switch is still a bit inconvenient. Because the environment is different, the original author with a Mac, and I use CentOS, some places there is not the same, so the record to facilitate their own later access.
Installation under CentOS
First I yum install tmux
tried to install it. Estimated no source, no Tmux found. So habitually directly find source code installation.
But there are dependencies that need to be installed first libevent
.
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gztar xzvf libevent-2.0.21-stable.tar.gzcd libevent-2.0.21-stable./configure && makemake install
Then download the source installation Tmux
git clone git://git.code.sf.net/p/tmux/tmux-code tmuxcd tmuxsh autogen.sh./configure && makemake install
In the process encountered two error, the solution is relatively simple, of course, after consulting the information.
Question 1:
During the period I encountered the execution autogen.sh error, because I did not install Automake. This yum install automake
is a straightforward solution.
Question 2:
Execution of the time encountered
libevent-2.0.so.5: cannot open shared object file: No such file or directory
The error, the solution is also relatively simple, since can not find, then change to find the place Bai.
ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5 # 32位系统ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5 # 64位系统
Use and shortcut keys
Enter Tmux directly at the command line to enter Tmux mode.
Tmux mainly have Windows Forms Operations and pane operations, personally think that windows for me, the meaning is not very significant (not to say that Windows mode does not apply to the scene), so here is the main pane related operations.
Shortcut keys
Tmux's shortcut keys must be pressed first C-b(Ctrl-b)
. Then click on the table below to achieve the corresponding effect.
Session and other related shortcut keys
shortcut Keys |
function |
C-z |
Close the Tmux. |
: |
Enter the TMUX command line mode. |
? |
Lists all the shortcut keys. |
T |
Displays the time. |
D |
Exits the current Tmux client, Tmux running in the background. |
$ |
Renames the current session. |
S |
Toggle session display all sessions and switch to a session. |
( |
Switch session to switch to the previous session. |
) |
Toggle session Switch to the next session. |
L |
Toggles the session to the previous active session. |
Window related shortcut keys
shortcut Keys |
function |
C |
Add a window. |
& |
Exits the current window. |
, |
Renames the current window. |
L |
Jumps to the previous window. |
I |
Displays the information for the current window. |
W |
Toggle window to display all Windows and Toggle window. |
0 to 9 |
Switch window to the corresponding numbered window. |
P |
Toggles window on the previous window. |
N |
Toggle window Next window. |
’ |
Toggle window to enter the numbered window. |
F |
Toggles the window to the Search window. |
Space |
Changes the pane layout under the current window. |
pane related shortcut keys
shortcut Keys |
function |
! |
Removes the current pane from the window. |
" |
Turns the current pane into top and bottom two pane. |
% |
Turn the current pane into left and right two pane. |
X |
Closes the current pane. |
Q |
Displays the index of the pane. |
Z |
Maximizes or restores the current pane. |
{ |
Before a pane swap position. |
} |
Swap positions with the latter one pane. |
O |
Switch pane to the next pane. |
; |
Switch pane into the previous Operation pane. |
Up, off, right |
Toggle pane Use the arrow keys to switch to the pane in the corresponding direction. |
There may be some shortcut keys in some way, if you can remind. In addition some shortcut keys do not understand, and shortcut keys are more, personally think remember the main switch shortcut key is enough to use. Compare Tmux is just a help tool, there is no need to be so it. Bold is a person feel more practical.
Tmux does not interrupt the session mode is really 666666, each time you can quickly connect back to the last end of the environment. and multiple pane are also ideal for situations where multiple services are to be opened and monitored.
Resources
- http://cenalulu.github.io/linux/tmux/
- Http://elroyjetson.org/dev-notes/centos/installing-tmux-on-centos-6-2
- http://www.nigeldunn.com/2011/12/11/libevent-2-0-so-5-cannot-open-shared-object-file-no-such-file-or-directory/
Article sync to GitHub blog, please reprint please keep the original link:
Original address: http://veiyn.com/2015/04/28/401-deploy-tmux/
[Linux] Installation and use of Tmux under CentOS