In Linux terminal operations, sometimes it is necessary to operate on multiple terminals, and switching between windows requires a lot of time. So what methods can speed up the operation of the terminal? In fact, using Tmux will solve this problem perfectly. The following small series will introduce you to the way Linux uses Tmux to improve the efficiency of terminal operation.
Tmux is one of my daily work necessary tools. I can build a complex development environment with Tmux, and I can also connect SSH remotely. I can open a lot of windows, split it into many panels, take over and separate sessions, and more. After mastering Tmux, you can throw away the mouse.
Tmux ("Terminal Multiplexer") can allow us to open many terminals under the flexible layout of a single screen, and we can use them collaboratively. For example, in one panel, we use Vim to modify some configuration files. In another panel, we use irssi to chat, while in the remaining panels, we can track some logs. Then, we can open a new window to upgrade the system, and then open a new window to the server's ssh connection. It's as simple as browsing between these window panels to switch between them. It's highly configurable and customizable, making it an extension of your mind
Installing Tmux under Linux/OSX (see the steps for installing the Tmux software from the System Home CentOS).
You can install it by compiling the software source or by using the system package manager. I recommend using the package manager, which is faster and easier than compiling.
OSX:
# sudo brew Install tmux
# sudo port install tmux
Debian/Ubuntu:
# sudo apt-get install tmux
RHEL/CentOS/Fedora(RHEL/CentOS requires EPEL repo):
$ sudo yum install tmux
Archlinux:
$ sudo pacman -S tmux
Working with different sessions
The best way to use Tmux is to use a session, so you can organize tasks and applications into different sessions the way you want. If you want to change a session, there is no need to stop or kill any work in the session. Let's see how this works.
Let's start a session called "session" and run the top command
$ tmux new-s new session
$ top
Enter CTRL-b d to detach from this session. To reconnect to this session, enter:
$ tmux attach-session -t session
After that you will see that the top operation is still running again. Connected on the session.
Some commands for managing sessions:
$ tmux list-session
$ tmux new-session "session name"
$ tmux attach-session - t "session name"
$ tmux rename-session -t "session name"
$ tmux choose-session -t "session name"
$ tmux kill-session -t "session name"
Working with different windows
In many cases, you need to run multiple commands in a single session to perform multiple tasks. We can organize them in multiple windows of a session. In modern GUI terminals (such as iTerm or Konsole), a window is treated as a label. After configuring our default environment in the session, we are able to create many of the windows we need in one session. A window is like an application running in a session. When we are out of the current session, it is still going on. Let's look at an example:
$ tmux new-s my_session
Next page Total 2 pages
For the Linux beginners who just started, I still dont know how to configure the ip
If you want to search for text files in Linux system, you can use grep command. With grep command, y
What is the /etc/group file, and what does the /etc/group file do? In fact, the /etc/group file in t
In Linux terminal operations, sometimes it is necessary to operate on multiple terminals, and switch
Ubuntu 14.04 running adb error how to do?
Linux recovery root password two methods
Linux ln command operation guide
How to use dd command in Linux system
How Linux looks at the last reboot time
Linux system hard disk failure repair method
Two classifications of Linux system commands
Teach you how to install Nessus software in Kali Linux
Linux configuration yum.conf method
Linux prompts when you use Mkdir can not create directory ‘test’?
Several reasons why Windows systems are slowing down
Windows 8 system can read PDF and XPS files directly
How does the windows7 system desktop not display the recycle icon
Win8 system can not open the software, can not log in how to solve the
Techniques for installing source software under Linux system
Solution for Win7 Disk to Unmarked Volume
Linux adds sudo rights to ordinary users
Win7 execution bat batch file shows garbled how to solve
Win7 sound icon bottom right corner of the lower right corner