kitten-transfer(1) | kitty | kitten-transfer(1) |
kitten-transfer - Transfer files easily over the TTY device
New in version 0.30.0.
Transfer files to and from remote computers over the TTY device itself. This means that file transfer works over nested SSH sessions, serial links, etc. Anywhere you have a terminal device, you can transfer files.
This kitten supports transferring entire directory trees, preserving soft and hard links, file permissions, times, etc. It even supports the rsync protocol to transfer only changes to large files.
SEE ALSO:
Simply ssh into a remote computer using the ssh kitten and run the this kitten (which the ssh kitten makes available for you on the remote computer automatically). Some illustrative examples are below. To copy a file from a remote computer:
<local computer> $ kitten ssh my-remote-computer <remote computer> $ kitten transfer some-file /path/on/local/computer
This, will copy some-file from the computer into which you have SSHed to your local computer at /path/on/local/computer. kitty will ask you for confirmation before allowing the transfer, so that the file transfer protocol cannot be abused to read/write files on your computer.
To copy a file from your local computer to the remote computer:
<local computer> $ kitten ssh my-remote-computer <remote computer> $ kitten transfer --direction=upload /path/on/local/computer remote-file
For more detailed usage examples, see the command line interface section below.
NOTE:
Normally, when you start a file transfer kitty will prompt you for confirmation. This is to ensure that hostile programs running on a remote machine cannot read/write files on your computer without your permission. If the remote machine is trusted, then you can disable the confirmation prompt by:
WARNING:
This kitten has the ability to use the rsync protocol to only transfer the differences between files. To turn it on use the --transmit-deltas option. Note that this will actually be slower when transferring small files or on a very fast network, because of round trip overhead, so use with care.
The source code for this kitten is available on GitHub.
kitty +kitten transfer [options] source_files_or_directories destination_path
Transfer files over the TTY device. Can be used to send files between any two computers provided there is a TTY connection between them, such as over SSH. Supports copying files, directories (recursively), symlinks and hardlinks. Can even use an rsync like protocol to copy only changes between files. When copying multiple files, use the --confirm-paths option to see what exactly will be copied. The easiest way to use this kitten is to first ssh into the remote computer with the ssh kitten:
$ kitten ssh my-remote-computer
Then, on the remote computer run the transfer kitten to do your copying. To copy a file from the remote computer to the local computer, run:
$ kitten transfer remote-file /path/to/local-file
This will copy remote-file from the remote computer to /path/to/local-file on the local computer.
Similarly, to copy a file from the local computer to the remote one, run:
$ kitten transfer --direction=upload /path/to/local-file remote-file
This will copy /path/to/local-file from the local computer to remote-file on the remote computer.
Multiple files can be copied:
$ kitten transfer file1 file2 /path/to/dir/
This will put file1 and file2 into the directory /path/to/dir/ on the local computer.
Directories can also be copied, recursively:
$ kitten transfer dir1 /path/to/dir/
This will put dir1 and all its contents into /path/to/dir/ on the local computer.
Note that when copying multiple files or directories, the destination must be an existing directory on the receiving computer. Relative file paths are resolved with respect to the current directory on the computer running the kitten and the home directory on the other computer. It is a good idea to use the --confirm-paths command line flag to verify the kitten will copy the files you expect it to.
Kovid Goyal
2024, Kovid Goyal
November 11, 2024 | 0.32.2 |