👿TMUX Command

หลายคนคงเคยใช้งาน Terminal เพื่อพิมพ์คำสั่ง Command ต่าง ๆ หรืออาจจะเข้าผ่าน SSH เช่น Putty, SecureCRT ซึ่งหากใครต้อง SSH ไปหลาย ๆ เครื่องแล้วพิมพ์คำสั่งเหมือนกันขอแนะนำ Terminal Multiplexer ( TMUX ) ทำให้เราไม่ต้องเสียเวลา SSH ไปพิมพ์ทีละเครื่อง สำหรับคนที่ใช้ Windows 10 สามารถทำการติดตั้งบน Windows Subsystem for Linux ( WSL ) ได้เลย

Basic TMUX

  • Show Session

#
tmux list-sessions
  • Create Session

#
tmux new -s session_name
  • Attach Session

#
tmux attach -t session_name
  • Kill Session

#
tmux kill-session -t session_name
  • Kill All Session

#
tmux ls | grep : | cut -d. -f1 | awk '{print substr($1, 0, length($1)-1)}' | xargs kill
  • Show Pane

#
tmux list-panes

Pane ( Split ) – prefix ( ctrl + b )

% : vertical split
 " : horizontal split
 o : swap pane
 q : show pane number
 x : kill pane
 + : break pane into window
 - : restore pane from window
 :setw synchronize-panes : sync pane
 :setw synchronize-panes off : stop sync pane

Windows ( Tab ) – prefix ( ctrl + b )

 c : create window
 w : list windows
 n : next window
 p : previous window
 f : find window
 , : name window
 & : kill window

อ่านเพิ่มเติม : https://bit.ly/2dZzTI3

Last updated

Was this helpful?