tmux cheatsheet

DESCRIPTION

tmux is an open-source terminal multiplexer for Unix-like operating systems. It allows multiple terminal sessions to be accessed simultaneously in a single window.

SYNOPSIS

### tmux [-28lCquvV] [-c shell-command] [-f file] [-L socket-name] [-S socket-path] [command [flags]]
# Simple way
tmux [command [flags]]

command [flags]

This specifies one of a set of commands used to control tmux, as described in the following sections.
If no commands are specified, the new-session command is assumed.

CLIENTS AND SESSIONS

The tmux server manages clients, sessions, windows and panes.
In tmux, a session is displayed on screen by a client and all sessions are managed by a single server.
Clients are attached to sessions to interact with them, either when they are created with the new-session command, or later with the attach-session command.

Each session has one or more windows linked into it. Windows may be linked to multiple sessions and are made up of one or more panes, each of which contains a pseudo terminal.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

# tmux new-session -s session-name
# alias: new-session = new
tmux new -s my-session

list sessions:

# tmux list-sessions
# alias: list-session = ls
tmux ls

attach to named:

# tmux attach-session -t target-session
# alias: attach-session = attach/at/a
tmux attach -t my-session

kill session:

tmux kill-session -t myname

Kill all the tmux sessions:

tmux ls | grep : | cut -d. -f1 | awk '{print substr($1, 0, length($1)-1)}' | xargs kill

List all shortcuts

to see all the shortcuts keys in tmux simply use the bind-key ? in my case that would be CTRL-B ?

Sessions

    d  detach from tmux, leaving everything running in the background
    s  list sessions
    $  name session
    :new-session  new session
    :<CR>  new session

Windows

    w  list windows
    c  create window
    ,  name window
    
    n  next window
    p  previous window
    
    f  find window
    &  kill window

Panes (splits)

    %  vertical split
    "  horizontal split
    x  kill pane
    
    q  show pane numbers
    o  swap panes
    ctrl-b, <arrow key>  switch to the pane in whichever direction you press

References:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值