Skip to content

Instantly share code, notes, and snippets.

@davidnvq
Created March 6, 2018 14:16
Show Gist options
  • Save davidnvq/ad1b687227b655aef5c2f4157bb014c0 to your computer and use it in GitHub Desktop.
Save davidnvq/ad1b687227b655aef5c2f4157bb014c0 to your computer and use it in GitHub Desktop.
Multi-session in terminal
# Using two packages `tmux` (Ctrl+B) and `screen` (Ctrl+A):
#1. Create a new session:
#tmux
tmux new -s session_name
#screen
screen -S session_name
#2. Attach to the session:
#tmux
tmux a -t session_name
#screen
screen -r session_name
#3. Deattach a session
#tmux
(Ctrl + B) D
#screen
(Ctrl + A) D
#4. Terminate a session
exit
#5. Tmux command
# Create a new window inside a session
(Ctrl + B) C
# List all the windows inside a session
(Ctrl + B) W
# Rename a window in a session:
(Ctrl + B) ,
# Delete a window in a session:
(Ctrl + B) &
@davidnvq
Copy link
Author

# Using package`screen` (Ctrl+A):

#1. Create a new session: 
screen -S session_name

#2. Attach to the session:
#screen
screen -r session_name

#3. Deattach a session
#screen 
(Ctrl + A) D

#4. Terminate a session
exit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment