Giter Club home page Giter Club logo

trzsz-go's Introduction

trzsz-go

trzsz ( trz / tsz ) is a simple file transfer tools, similar to lrzsz ( rz / sz ), and compatible with tmux.

Website: https://trzsz.github.io/go  中文文档:https://trzsz.github.io/cn/go

MIT License GitHub Release

Please check https://trzsz.github.io for more information of trzsz.

trzsz-go is the go version of trzsz, supports native terminals that support a local shell.

⭐ It's recommended to use the go version of trzsz on the server.

Installation

  • Install with apt on Ubuntu

    sudo apt install trzsz
    sudo apt update && sudo apt install software-properties-common
    sudo add-apt-repository ppa:trzsz/ppa && sudo apt update
    
    sudo apt install trzsz
  • Install with apt on Debian

    sudo apt install trzsz
    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
  • Install with yum on Linux

    sudo yum install trzsz
    • Install with gemfury repository.

      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 with wlnmp repository. It's not necessary to configure the epel repository for trzsz, take CentOS as an example:

      sudo rpm -ivh https://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm
      
      sudo yum install trzsz
  • Install with yay on ArchLinux

    yay -S trzsz
    yay -Syu
    yay -S trzsz
  • Install with homebrew on MacOS

    brew install trzsz-go
    brew update
    brew install trzsz-go
  • Install with scoop on Windows

    scoop install trzsz
    scoop bucket add extras
    scoop update
    scoop install trzsz
  • Install with Go ( Requires go 1.20 or later )

    go install github.com/trzsz/trzsz-go/cmd/...@latest
    go install github.com/trzsz/trzsz-go/cmd/trz@latest
    go install github.com/trzsz/trzsz-go/cmd/tsz@latest
    go install github.com/trzsz/trzsz-go/cmd/trzsz@latest

    The binaries are usually located in ~/go/bin/ ( C:\Users\your_name\go\bin\ on Windows ).

  • Download from the Releases

    Or build and install from the source code ( Requires go 1.20 or later )
    git clone https://github.com/trzsz/trzsz-go.git
    cd trzsz-go
    make
    sudo make install

Usage

Use on the local computer

  • Add trzsz before the shell to support trzsz ( trz / tsz ), e.g.:

    trzsz bash
    trzsz PowerShell
    trzsz ssh x.x.x.x
  • Add trzsz --dragfile before the ssh to enable drag files and directories to upload, e.g.:

    trzsz -d ssh x.x.x.x
    trzsz --dragfile ssh x.x.x.x

Use on the jump server

  • If using tmux on the jump server, use trzsz --relay ssh to login to the remote server, e.g.:

    trzsz ssh jump_server
    tmux
    trzsz --relay ssh remote_server

Use on the remote server

Suggestion

  • It is recommended to set alias ssh="trzsz ssh" for convenience, alias ssh="trzsz -d ssh" for dragging files to upload.

  • If using tmux on the local computer, run tmux ( without trzsz ) first, then trzsz ssh to login.

Configuration

trzsz looks for configuration at ~/.trzsz.conf ( C:\Users\your_name\.trzsz.conf on Windows ). The path have to end with /, e.g.:

DefaultUploadPath =
DefaultDownloadPath = /Users/username/Downloads/
  • If the DefaultUploadPath is not empty, the path will be opened by default while choosing upload files.

  • If the DefaultDownloadPath is not empty, downloading files will be saved to the path automatically instead of asking each time.

Trouble shooting

  • If using MSYS2 or Git Bash on windows, and getting an error The handle is invalid.

    • Install winpty by pacman -S winpty in MSYS2.
    • Git Bash should have winpty installed, no need to install it manually.
    • Add winpty before trzsz, e.g.: winpty trzsz ssh x.x.x.x.
  • The /usr/bin/ssh in MSYS2 and Cygwin is not supported yet, use the OpenSSH instead.

    • In MSYS2, e.g.: winpty trzsz /c/Windows/System32/OpenSSH/ssh.exe x.x.x.x.
    • In Cygwin, e.g.: trzsz "C:\Windows\System32\OpenSSH\ssh.exe" x.x.x.x.
    • ⭐ Recommended to use trzsz-ssh ( tssh ) instead, tssh is same as trzsz ssh.
  • Dragging files doesn't upload?

    • Don't forget the --dragfile option. e.g.: trzsz -d ssh x.x.x.x.
    • Make sure the trz in one of the PATH directory on the server.
    • On Windows, make sure there is no Administrator on the title.
    • The cmd and PowerShell only support draging one file into it.
    • On the Windows Terminal, drag files to the top left where shows Paste path to file.

Development

Want to write your own ssh client that supports trzsz? Please check the go ssh client example.

Screenshot

Windows

windows trzsz ssh

Ubuntu

ubuntu trzsz ssh

Drag files

drag files ssh

Contact

Feel free to email the author [email protected], or create an issue. Welcome to join the QQ group: 318578930.

Sponsor

Want to buy the author a drink 🍺 ?

sponsor wechat qrcode sponsor alipay qrcode

Thanks @BrightXiaoHan @pmzgit.

trzsz-go's People

Contributors

lonnywong avatar amo996 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.