shell
一常用命令
# 文件上传
trz [-h] [-v] [-q] [-y] [-b] [-e] [-d] [-B N] [-t N] [path]
# 文件下载
tsz [-h] [-v] [-q] [-y] [-b] [-e] [-d] [-B N] [-t N] [path]
# 默认值保存当前目录
-h, --help 帮助
-v, --version 版本
-q, --quiet quiet 隐藏进度条
-y, --overwrite yes, 覆盖现有文件
-b, --binary 二进制传输模式,对于二进制文件更快
-e, --escape 转义所有已知控制字符
-d, --directory 传输目录和文件
-B N, --bufsize N 最大缓冲区大小 (1K<=N<=1G). (默认: 10M)
-t N, --timeout N 缓冲区超时时间啊(毫秒) N <= 0 0表示从不超时(默认值:10)
# 开启文件拖拽
trzsz -d ssh x.x.x.x
trzsz --dragfile ssh x.x.x.x
二服务端安装
# 服务器端
sudo python3 -m pip install --upgrade trzsz
三客户端安装
# mac端
brew update
brew install trzsz
# 终端文件拖拽上传
brew install trzsz-go
四配置 iterm
查看 trzsz-iterm2 路径
which trzsz-iterm2
打开 iTerm2 -> Preferences... -> Profiles -> ( 在左边选中一个 Profile ) -> Advanced -> Triggers -> Edit -> [+]
五 参数说明
参数 | 值 |
---|---|
Regular Expression | (:TRZSZ:TRANSFER:[SRD]:\d+\.\d+\.\d+:\d+) |
Action | Run Silent Coprocess... |
Parameters | /opt/homebrew/bin/trzsz-iterm2 \1 |
Enabled | 选中 |
Use interpolated strings for parameters | 不选 |