Author: JackTian
Source: Public Account "Jake's IT Journey"
ID: Jake_Internet
Link: This alternative file transfer tool is amazing!
In a certain scenario, considering LapTop -> Host 1 -> Host 2 -> Docker -> TMUX, it is inconvenient to use scp or sftp commands. It is much more convenient to use rz and sz commands, but it is not compatible with TMUX.
So, the artifact recommended to everyone today is absolutely delicious.
trzsz (trz / tsz) is a file transfer tool developed based on Python programming language and compatible with TMUX, similar to lrzsz (rz / sz), and trzsz has a progress bar, supports directory transfer and file drag upload, supports iTerm2, Tabby, Electerm , TTYD terminal.
trzsz-go is trzsz implemented based on the Go language. It does not need to rely on the support of the terminal to upload and download files.
trzsz-js supports Windows local cmd, PowerShell, etc.; supports directory trz -d upload and tsz -d xxx download; supports dragging files and directories to upload directly to the server.
install trzsz
Ubuntu install with apt:
# sudo apt update && sudo apt install software-properties-common
# sudo add-apt-repository ppa:trzsz/ppa && sudo apt update
# sudo apt install trzsz
Debian install with apt:
# sudo apt install curl gpg
# curl -s 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x7074ce75da7cc691c1ae1a7c7e51d1ad956055ca' \
| gpg --dearmor -o /usr/share/keyrings/trzsz.gpg
# echo 'deb [signed-by=/usr/share/keyrings/trzsz.gpg] https://ppa.launchpadcontent.net/trzsz/ppa/ubuntu jammy main' \
| sudo tee /etc/apt/sources.list.d/trzsz.list
# sudo apt update
# sudo apt install trzsz
Linux install with yum:
echo '[trzsz]
name=Trzsz Repo
baseurl=https://yum.fury.io/trzsz/
enabled=1
gpgcheck=0' | sudo tee /etc/yum.repos.d/trzsz.repo
sudo yum install trzsz
Install on Mac with homebrew:
brew update
brew install trzsz-go
Windows installation with scoop:
scoop bucket add extras
scoop install trzsz
Or download the source code from GitHub and install:
git clone https://github.com/trzsz/trzsz-go.git
cd trzsz-go
make
sudo make install
use trzsz
Usage of trz to upload files to remote server:
trz [-h] [-v] [-q] [-y] [-b] [-e] [-d] [-B N] [-t N] [path]
- -h: help message and exit
- -v: display version and exit
- -q: When transferring files, hide the progress bar
- -y: If the same file name exists, overwrite the existing file directly
- -b: Binary transmission mode, it will be faster for compressed packages, pictures, audio and video transmission
- -e: escape all known control characters
- -d: upload and download specified files or folders
- -b: Set the upper limit of the maximum buffer, which will automatically select the appropriate buffer size according to the network speed, but will not exceed this upper limit. (default: 10M)
- -t: Set the timeout seconds (default: 20 seconds). If within the timeout period, if the data of a buffer size cannot be transferred, an error will be reported and exited. When set to 0 or a negative number, it never times out.
- path: The path to save the file. (default: current directory)
If trz does not take any parameters, the file to be uploaded will be placed in the current directory, or the directory to be uploaded can be specified.
# trz
# trz /opt
Use the login server locally trzsz ssh IP地址
, or use trzsz -d ssh IP地址
the login to support dragging files and folders to upload.
Usage of tsz to download a file from a remote server:
tsz [-h] [-v] [-q] [-y] [-b] [-e] [-d] [-B N] [-t N] file [file ...]
- file: the file to download
tsz can download one or more files, you can use relative paths or absolute paths, or you can use wildcards to download specified files.
# tsz file1 file2 file3
As mentioned above, you can use trz
and tsz
upload and download methods combined with actual scenarios to experience the alternatives to rz
and .sz
In addition, the trzsz Chinese document also provides some common abnormal problem handling methods.
References
trzsz:https://github.com/trzsz/trzsz
trzsz-go:https://github.com/trzsz/trzsz-go
trzsz-js:https://github.com/trzsz/trzsz.js
trzsz 中文下载:https://trzsz.github.io/cn/
The above is all the content to be shared today.
If you think this article is useful to you, please contribute to this article 点个赞
, 留个言
or 转发
read it, and let more friends see it, because this will be the strongest motivation for me to continue to output more high-quality articles!