tmux: creating virtual linux sessions instances - jamiefogel/Networks GitHub Wiki
Creating a new linux session / instance with tmux
tmux new-session -s our_session_name
- Within this session, we can create additional sessions / instances by pressing
Ctrl-bfollowed byc(Ctrl-b, c). This creates a new window where we can run different commands. - To switch between windows, press
Ctrl-bfollowed by a number (e.g.,Ctrl-b, 0for the first window,Ctrl-b, 1for the second, and so on). - To detach from the current tmux session, press
Ctrl-bfollowed byd(Ctrl-b, d).
To list all sessions:
tmux list-sessions
To recover a specific session:
tmux attach-session -t your_session_name
To rename a session:
rename-session session_name
How to run python code within tmux
Run it interactively in emacs or command line python within tmux.
To kill a session without entering it
tmux kill-session -t session_name_or_id