Difference between revisions of "Tmux"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Line 2: Line 2:
 
[[wikipedia:tmux|tmux]]<ref>http://man7.org/linux/man-pages/man1/tmux.1.html</ref> is a [[terminal multiplexer]] first released in 2007.
 
[[wikipedia:tmux|tmux]]<ref>http://man7.org/linux/man-pages/man1/tmux.1.html</ref> is a [[terminal multiplexer]] first released in 2007.
  
Basic command usage:
+
===Basic command usage===
 
* <code>tmux ls</code><ref>https://gist.github.com/MohamedAlaa/2961058</ref>  
 
* <code>tmux ls</code><ref>https://gist.github.com/MohamedAlaa/2961058</ref>  
<pre>
 
Example shows two running sessions: 0 and my_named_session:
 
tmux ls
 
0: 1 windows (created Sat Sep 15 09:38:43 2018) [158x35]
 
my_named_session: 1 windows (created Sat Sep 15 10:13:11 2018) [78x35]
 
</pre>
 
 
 
* Config file: <code>$HOME/[[.tmux.conf]]</code>
 
* Config file: <code>$HOME/[[.tmux.conf]]</code>
 
 
 
* <code>tmux -f your_tmux_config_file.conf</code>
 
* <code>tmux -f your_tmux_config_file.conf</code>
 
* <code>tmux new -s my_session_name</code>
 
* <code>tmux new -s my_session_name</code>
 
 
* <code>tmux a</code> or <code>tmux attach</code> Attach to last used session.<ref>https://medium.com/actualize-network/a-minimalist-guide-to-tmux-13675fb160fa</ref>
 
* <code>tmux a</code> or <code>tmux attach</code> Attach to last used session.<ref>https://medium.com/actualize-network/a-minimalist-guide-to-tmux-13675fb160fa</ref>
 
* <code>tmux attach -t my_session_name</code> or <code>tmux attach-session -t my_session_name</code>
 
* <code>tmux attach -t my_session_name</code> or <code>tmux attach-session -t my_session_name</code>
 
* <code>tmux attach -t 0</code> or <code>tmux attach-session -t 0</code>
 
* <code>tmux attach -t 0</code> or <code>tmux attach-session -t 0</code>
 
 
 
* <code>[[tmux kill-server]]</code>
 
* <code>[[tmux kill-server]]</code>
 +
* [[Detach]]: <code>[[Ctrl+b]] d</code>
  
* [[Detach]]: <code>[[Ctrl+b]] d</code>
+
===Examples===
 +
Example shows two running sessions: 0 and my_named_session:  
 +
<pre>
 +
tmux ls
 +
0: 1 windows (created Sat Sep 15 09:38:43 2018) [158x35]
 +
my_named_session: 1 windows (created Sat Sep 15 10:13:11 2018) [78x35]
 +
</pre>
  
 
== Activities ==
 
== Activities ==

Revision as of 12:18, 13 September 2021

tmux[1] is a terminal multiplexer first released in 2007.

Basic command usage

  • tmux ls[2]
  • Config file: $HOME/.tmux.conf
  • tmux -f your_tmux_config_file.conf
  • tmux new -s my_session_name
  • tmux a or tmux attach Attach to last used session.[3]
  • tmux attach -t my_session_name or tmux attach-session -t my_session_name
  • tmux attach -t 0 or tmux attach-session -t 0
  • tmux kill-server
  • Detach: Ctrl+b d

Examples

Example shows two running sessions: 0 and my_named_session:

tmux ls
0: 1 windows (created Sat Sep 15 09:38:43 2018) [158x35]
my_named_session: 1 windows (created Sat Sep 15 10:13:11 2018) [78x35]

Activities

  1. Open a tmux session, disconnect your computer and reconnect again to your previous session using tmux attach or tmux a
  2. Transfer current command to a detachable session (reptyr): https://superuser.com/questions/623432/transfer-current-command-to-a-detachable-session-tmux-screen
  3. Add set -g mouse on to your $HOME/.tmux.conf file to scroll using your mouse.[4] (tmux kill-server)

Related terms

See also

  • http://man7.org/linux/man-pages/man1/tmux.1.html
  • https://gist.github.com/MohamedAlaa/2961058
  • https://medium.com/actualize-network/a-minimalist-guide-to-tmux-13675fb160fa
  • https://superuser.com/a/510310
  • https://linux.die.net/man/1/reptyr
  • Advertising: