Uses of tmux explained

24,751 views

Published on

Published in: Technology
5 Comments
25 Likes
Statistics
Notes
No Downloads
Views
Total views
24,751
On SlideShare
0
From Embeds
0
Number of Embeds
187
Actions
Shares
0
Downloads
86
Comments
5
Likes
25
Embeds 0
No embeds

No notes for slide

Uses of tmux explained

  1. 1. Uses of tmux explained (for fun & sysadmin)Stanislas Polu June 7th 2013 bit.ly/tmux- explained Made by nitrogr.am
  2. 2. What is a terminal multiplexer? It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal. And do a lot more. http://tmux.sourceforge.net
  3. 3. tmux (server) Unix Domain Socket: /tmp/tmux-{uid}/default pts/0 pts/1 @spolu @x1t0 tmux (screen) tmux (screen) pts/4 pts/5 pts/6 ssh bash vim TMUX Architecture
  4. 4. tmux (server) /tmp/tmux-{uid}/default pts/0 @spolu tmux (screen) pts/4 $ tmux bash Starting TMUX (openpty)
  5. 5. tmux (server) pts/0 @spolu tmux (screen) pts/4 $ bash Starting TMUX pts/5 bash C-b c /tmp/tmux-{uid}/default
  6. 6. tmux (server) pts/0 @spolu tmux (screen) pts/4 $ fsck /dev/md2 bash Detach - Attach pts/5 fsck /tmp/tmux-{uid}/default
  7. 7. tmux (server) pts/4 $ bash Detach - Attach pts/5 fsck C-b d pts/0 @spolu bash /tmp/tmux-{uid}/default
  8. 8. tmux (server) pts/0 @spolu tmux (screen) pts/4 $ tmux attach bash Detach - Attach pts/5 fsck /tmp/tmux-{uid}/default
  9. 9. tmux (server) /tmp/pair pts/4 bash Screen Sharing pts/0 @spolu tmux (screen) $ tmux -S /tmp/pair $ chmod 777 /tmp/pair @spolu
  10. 10. tmux (server) /tmp/pair pts/4 $ tmux -S /tmp/pair new $ chmod 777 /tmp/pair bash Screen Sharing @spolu pts/0 pts/1 @spolu @x1t0 tmux (screen) tmux (screen) $ tmux -S /tmp/pair attach @x1t0
  11. 11. #!/bin/sh alias tmux-shared="tmux -S /tmp/tmux-shared" tmux-shared new-session -d -s str1 chmod 777 /tmp/tmux-shared tmux-shared new-window -t str1:1 -n 'str1-1' 'ssh nitrogram@str1-1' tmux-shared new-window -t str1:1 -n 'str1-2' 'ssh nitrogram@str1-2' tmux-shared new-window -t str1:1 -n 'str1-3' 'ssh nitrogram@str1-3' tmux-shared kill-window -t str1:0 tmux-shared select-window -t hawkhost:1 tmux-shared attach -t hawkhost SysAdmin Trick
  12. 12. THIS THING IS POWERFUL, BUT...

×