tmux command - what is tmus | Getting Started with Tmux | Tmux Session attached and detached

Linuxtopic
0
tmux | tmux command | what is tmux

TMux full form
Tmux full form is terminal multiplexer

Tmux

Tmux is terminal multiplexer for unix like operating system that is used to start multiple session. It help us to open multiple windows in session simultaneously.
We can easily switch in multiple application by detach session and reattached the same session in different terminal.

Advantage of Tmux

The most advantage to use of Tmux, it will continues run our  program / application even if we get
discontinued or disconnected from the network accidentally.

Alternate of Tmux:

screen command : screen is similar to tmux,  Click here to read screen

Install Package of Tmux :

CentOS / RHEL

yum install tmux


Ubuntu / Debian

apt install tmux

Mac OS

brew install tmux

Getting Start with Tmux

Before we can start working on tmux command first we will check the manual of tmux by execute the below command on terminal

man tmux


We can find all relevant information in this manual scroll down and read manual carefully if you want to learn more, here we will cover basic most frequently used of tmux

To start session, run below command on terminal

tmux



This is tmux session window, you can find the session number, user and hostname and date & time of the bottom by green line.

the default prefix of tmux is "ctrl + b" so we can manage the session by pressing the both key simultaneously and then press command key like help "?", "c" and so fourth

To list all command or help in session

Press together  Ctrl + b   then  ?


To detach this session

Press together  Ctrl + b   then  d


To list all tmux session

tmux ls


To attach or re-active or re-attached the session

tmux attach-session -t 0

Here tmux command,  attach-session is option for attach session, -t 0 is session number seen in above screenshot.

To use tmux command with session name

tmux new -s linuxtopic

Here tmux command, and -s is switch and linuxtopic is session name

To create new window in session :

Press together  Ctrl + b   then  c


In the bottom, we can find the active session like 0:root@lokesh and 1:root@lokesh

To list of all windows open in session

Press together  Ctrl + b   then  w



To switch windows , by session number like 0 1 and so fourth

Press together  Ctrl + b   then  0 or 1

To Split current pane horizontally into two panes

Press together  Ctrl + b   then  % (Shift + 5)


To Split current pane vertically into two panes

Press together  Ctrl + b   then " (Shift + ')


To switch pane

Press together  Ctrl + b   then o

To exit window

Press together  Ctrl + b   then x



Thanks



Post a Comment

0Comments

Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Check Now
Ok, Go it!