tmux practical use cases to execute commands on servers in parallel

Ticker

6/recent/ticker-posts

tmux practical use cases to execute commands on servers in parallel

     Tmux is a terminal multiplexer: it enables a number of terminals to be created,

     accessed, and controlled from a single screen.  tmux may be detached from a screen

     and continue running in the background, then later reattached.

     When tmux is started it creates a new session with a single window and displays it

     on screen.  A status line at the bottom of the screen shows information on the

     current session and is used to enter interactive commands.

    Specially while doing Kodekloud task its more convicent to run the same command , on        multiple servers


1. To Start a new session

$ tmux new

: new


2. To Show all sessions

 $ tmux ls

$ tmux list-sessions

Ctrl + b s


3. To Attach Sessions

$ tmux a -t mysession

$ tmux at -t mysession

$ tmux attach -t mysession


4. To kill / delete Sessions

$ tmux kill-ses -t mysession

$ tmux kill-session -t mysession


PANES 

1. Toggle last active pane

    Ctrl + b ;

2.Split pane horizontally

    Ctrl + b %

3. Split pane vertically

    Ctrl + b "

4. Move the current pane left

    Ctrl + b {

5., Move the current pane right

    Ctrl + b }

6. Switch to pane to the direction

Ctrl + b Ý   

            
Ctrl + b ß

7. Resize current pane height(holding second key is optional)

Ctrl + b Ý   

            
Ctrl + b ß

8. Toggle synchronize-panes (send command to all panes) 

Ctrl + b 

: setw synchronize-panes

9. Close current pane

Ctrl + b x

10. For More information about session, window, pane. 

$ tmux info


Happy Learning!!!!

Apart from this if you need more clarity,  I have made a  tutorial video on this, please go through and share your comments. Like and share the knowledge 






Post a Comment

0 Comments

Latest Posts