Skip to content

Instantly share code, notes, and snippets.

@marcoemorais
Created October 21, 2016 00:05
Show Gist options
  • Save marcoemorais/2371ef51ebf49f4643a60c2e8bba8a19 to your computer and use it in GitHub Desktop.
Save marcoemorais/2371ef51ebf49f4643a60c2e8bba8a19 to your computer and use it in GitHub Desktop.
tmux notes
# *** tmux subcommands ***
# start a new tmux session
tmux new-session -s [session-name]
# start a new tmux session with a named window
tmux new-session -s [session-name] -n [window-name]
# list running sessions
tmux ls
# attach to a running session
tmux attach -t [session-name]
# kill a running session
tmux kill-session -t [session-name]
# *** commands within tmux session ***
# send a command to tmux aka PREFIX (can be configured)
Ctrl-b
# Note: hereafter the prefix shown is Ctrl-b
# bring up a list of all commands
Ctrl-b ?
# detach (takes you back to the original terminal)
Ctrl-b d
# windows
# create a window
Ctrl-b c
# rename a window
Ctrl-b ,
# go to next window (current window will have an asterisk *)
Ctrl-b n
# go to previous window
Ctrl-b p
# go to window at index N (where N starts at 0)
Ctrl-b [N]
# find a window by name
Ctrl-b f
# open a menu to select window
Ctrl-b w
# close the window (terminate processes)
Ctrl-b &
# panes
# vertical split aka pane
Ctrl-b %
# horizontal split aka pane
Ctrl-b "
# close a split aka pane
Ctrl-b x
# cylce through splits aka panes
Ctrl-b o
Ctrl-b [up|down|right|left]
# cycle through some preconfigured pane layouts
Ctrl-b [spacebar]
# kill pane (useful when process is not responding)
Ctrl-b x
# shows numbers associated with panes
Ctrl-b q
# toggle the current pane to full screen
Ctrl-b z
# scroll buffer
# enter copy mode
Ctrl-b [
# leave copy mode
q
# page up
Ctrl-b
# page down
Ctrl-f
# clear selection buffer
ESC
# *** commands at tmux status bar ***
# bring status bar into focus
Ctrl-b :
# open a new named window
:new-window -n [window-name]
# open a new named window running a command
:new-window -n [window-name] "[cmd]"
# reload changes from tmux configuration file
:source-file ~/.tmux.conf
# swap windows at src-index with dest-index
:swap-window -s [src-index] -t [dest-index]
# rename session
:rename-session -t [old-session-name] [new-session-name]
# move window
# * with no arguments renumbers current window
# * with -r argument renumbers all windows
:move-window
:movew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment