Skip to content

LeoMerlino/clipboard-file-transfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Caution

I am very new to bash scripting, and as a result this script will have tons of bugs, possibly even ones leading to data loss! I am not responsible for any damage caused by this script.

Clipboard file transfer over terminal

This bash script provides a proof of concept method of transferring files and folders over terminals via the clipboard. For example, to transfer files over to a locked down machine with no internet access via ssh.

Showcase

Benchmarking speed

bench

It started off slow due to network traffic

Getting optimal compression method

gcm

Transferring folder

transfer

How to run this script (if you dare)

Download the latest transfer.bash script from the repo, and run with bash transfer.bash

Note

Use middleclick paste, not Ctrl + Shift + V

If you are on X11, then set the clipboard copy command to xclip with -c xclip, or clip for Windows.

Usage:

usage: transfer.bash [command] [-c <clip tool>] [-t <compression>] [file]

Args:
  -t  select compression type, e.g., `-t gz`
  -c  set clipboard copy method. Default: `wl-copy -p`

Commands:
  get-compression-method, gcm  Determine the optimal compression method supported on the target system
  bench                        Start a transfer speed benchmark (cool)

Examples:
  transfer.bash gcm                        Get optimal compression method
  transfer.bash -t gzip -c xclip file.txt  Transfer file with the gzip compression method

Roadmap:

  • Ability to choose compression strength
  • Calculate time remaining from the time for each packet to be transferred

PRs please!

Any PRs would be appreciated (this script could do with some improvements)

And learning is fun!

About

Proof of concept method of transferring files and folders over remote terminals via the clipboard

Resources

Stars

Watchers

Forks

Contributors

Languages