Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Terminal multiplexing tool tmux use     - Linux environment variable settings and save places (Linux)

- Netfilter / Iptables Comments (Linux)

- ORA-08102 errors (Database)

- CentOS 6.4 Telecom ADSL dial-up network configuration (Linux)

- Django how to generate content in non-HTML formats (Programming)

- To install MySQL 5.6 binary packages under CentOS 6.4 64bit (Database)

- Linux log management make the system more secure (Linux)

- Ubuntu 14.10 / 14.04 / 12.04 installation GNOME Pie 0.5.6 (Linux)

- Efficient running Linux virtual machine Six Tips (Linux)

- 12 Linux Process Management Commands (Linux)

- Python several standard types of built-in functions (Programming)

- How to Upgrade Ubuntu GNOME 14.10 to GNOME 3.16 Desktop (Linux)

- Oracle 11g creates virtual private directory RMAN-06004 ORA-00942 error handling (Database)

- Under CentOS Linux automatic backup MySQL database daily (Database)

- Btrfs file system creation and their characteristics in Linux (Linux)

- Linux Getting Started tutorial: How to backup Linux systems (Linux)

- Diagnose and resolve the SSH connection slow (Linux)

- Error code: 2013 Lost connection to MySQL server during query (Database)

- Linux Beginner Guide: Installing packages on Ubuntu and Fedora (Linux)

- Use pg_basebackup build PostgreSQL streaming replication environment (Database)

 
         
  Terminal multiplexing tool tmux use
     
  Add Date : 2016-11-19      
         
         
         
  Tmux role is to reuse the terminal.
1. Start a bash on the server, and run inside tmux
2. Log in via ssh remote server, run tmux attach, it will switch to the bash server on the subsequent operations are in a bash
3. You can open more windows, so that the remote can be the same as in the local use of multiple same bash

If you want to send the command, as follows:
tmux send -t checkpoint ls ENTER
NOTE: checkpoint you've created a good session with tmux name (tmux new -s checkpoint); ls is a shell command; plus ENTER to execute the ls command in this session of the checkpoint.
So you do not have to manually tmux attach to that session, and then manually execute the ls command. It is good to use a script.
If the session has multiple windows:
tmux send -t checkpoint: 0 'mongoose -t 2' ENTER
0 represents the first window.

Combined with parallel-ssh you can use the remote server environment to run the bash command.

Such a scenario is useful. On a single server with criu to a small program checkpoint, require criu and applets run in bash, rather than directly in ssh, otherwise img file checkpoint obtained will contain information related to the terminal associated with the ssh ( session id), so you can not restore it on another server, and that is impossible to achieve migration. And if in bash, and ssh will not have information about, and on another machine you can restore.

tmux Shortcuts

tmux use a lot of shortcuts in the session to control multiple windows, multiple sessions and the like.

Ctrl + b # to activate the console; this time the following keypresses
System Operation
    ? # List all shortcuts; press q to return
    d # departing from the current session; this can temporarily return to Shell interface, enter tmux attach to re-enter the previous session
    D # Select from the session; used when multiple sessions open simultaneously
    Ctrl + z # suspend the current session
    r # redrawn without departing from the mandatory session
    Used in multiple sessions open simultaneously; s # choice and switch sessions
    : # Enter the command line mode; then you can enter commands supported, such as kill-server can shut down the server
    [# Enter the copy mode; this time the same operation as vi / emacs, press q / Esc to exit
    ~ # List message cache; which contains a variety of message before returning tmux
Window Operations
    c # create a new window
    & # Close the current window
    # Numeric keys to switch to the specified window
    p # to switch to the previous window
    n # Switch to the next window
    l # switch back and forth between each other in two windows
    w # through the window list window switch
    # Rename the current window; it is easy to identify
    # Modify the current window number; corresponds to the window to reorder
    f # Find the specified text in all windows
Panel Operation
    "# The current flat panel is divided into two
    % # About the current panel is divided into two levels
    x # close the current panel
    ! # The current panel placed in a new window; that is, a new window that contains only the current panel
    Ctrl + arrow keys # 1 to the cell edge for mobile unit to adjust the size of the current panel
    Alt + arrow keys to # 5 cell edge for mobile unit to adjust the size of the current panel
    Space # in the preset panel layout to cycle; in turn includes even-horizontal, even-vertical, main-horizontal, main-vertical, tiled
    q # Display Panel No.
    o # Select the next panel in the current window
    # Move the cursor arrow keys to select the panel
    {# Forward displacement of the current panel
    } # Rearward displacement of the current panel
    Alt + o # counterclockwise rotation of the current window panel
    Ctrl + o # clockwise rotation of the current window panel
     
         
         
         
  More:      
 
- Windows7 system using Vagrant to build Linux virtualized development environment (Linux)
- Ease of use "Explain Shell" script to understand Shell command (Linux)
- PHP loop reference caused strange problems (Programming)
- VMware ghost Linux card error (Linux)
- OpenGL Superb Learning Notes - Depth Texture and Shadows (Programming)
- MySQL Installation Troubleshooting (Database)
- Node.js developers must know four JavaScript concepts (Programming)
- A script to make your Ubuntu 14.04 Memory screen brightness (Linux)
- Eclipse remove all comments and code spaces (Linux)
- Generators and iterators in Python (Programming)
- Whisker Menu 1.4.3 Install menu Linux (Linux)
- Linux-- sub-volume compression and decompression (Linux)
- Justniffer installed on Ubuntu 15.04 (Linux)
- php for Linux the MySQL extension module installation and configuration (Database)
- Manage SQL Server services login (start) account and password (Database)
- RHEL5.8 physical opportunities to Read-only file system (Linux)
- Oracle 11g forget approach SYS and SYSTEM password (Database)
- How to implement large-scale distributed Yahoo depth study on the Hadoop cluster (Server)
- Java data structures - order linear form of table ArrayList (Programming)
- Switching Virtual Machine + Ubuntu graphical interface and terminal interface (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.