代码之家  ›  专栏  ›  技术社区  ›  Reeves_Bot

在创建tmux会话时意外使用了-S而不是-S,我的会话在哪里?

  •  1
  • Reeves_Bot  · 技术社区  · 7 年前

    1 回复  |  直到 7 年前
        1
  •  0
  •   Arkadiusz Drabczyk    7 年前

    tmux 选项 -S 表示套接字路径(从 man tmux ):

     -S socket-path
                   Specify a full alternative path to the server socket.  If -S is specified, the default
                   socket directory is not used and any -L flag is ignored.
    

    tmux 与一起运行 选项并将此选项传递给 指向 替代套接字路径。例如,你可以找到 PID tmux

    $ ps aux | grep  '[t]mux'
    ja       15121  0.0  0.0  20252  2236 pts/6    S+   00:44   0:00 tmux -S new
    

    然后检查这个过程 cwd 在里面 /proc

    $ ls -l /proc/15121/cwd
    lrwxrwxrwx 1 ja users 0 Aug 19 00:52 /proc/15121/cwd -> /home/ja
    

    tmux 会话:

    $ tmux  -S /home/ja/new ls
    0: 1 windows (created Sat Aug 19 00:44:46 2017) [212x65] (attached)