Live data from Hacker News

Transfer.sh – File sharing from the command line

transfer.sh

61–70 of 117 posts

Re: Transfer.sh – File sharing from the command line

#61
post #40

I like it! But for me ssh already provides a simple and secure way to move files from one place or another.. tar -cf - ./files.txt ./orDir/ | ssh host "(cd /dest/dir; tar -xf -)" Given that ssh it so ubiquitous I think this will always be my go to.

This particular tool seems useful for sharing files with people who might not be comfortable with the command-line, or where you don't have an account on the receiver's computer, since it produces a regular http link to download the data.

Re: Transfer.sh – File sharing from the command line

#62

Earlier quoted context omitted.

What about good old scp? scp file.txt user@host:/dest/dir/

Or rsync? rsync -zvh file.txt user@host:/dest/dir/ So many ways to do this :)

rsync has always been my favourite because it makes the most sense to me (and the --help/man page is easy to read).

rsync -n -avh --progress source destination:~/asdf/ for a dry run followed by ctrl-p, ctrl-a, alt-f, alt-d, alt-d to remove the -n flag and then execute that for the real thing.

Occasionally though, I'll also use sftp if I'm just pulling one thing - perhaps even after sshing to the remote machine.

For all of these, SSH keys should be set up (and desktop logins secured) to make life easier.

As for Android, adb push and adb pull -a seems to work better than mtp:// or AirDroid in my experience.

Re: Transfer.sh – File sharing from the command line

#63
post #60

Btw, many unix files explorer can connect to many remote servers via ssh. Unless x less of course. All is integrated, local programs can read and edit those files as regular, drag and drop, folder, permissions with right click. I use the shell a lot, but remote bookmarks are wizardry!

And of course there is always sshfs

Re: Transfer.sh – File sharing from the command line

#65
post #40

I like it! But for me ssh already provides a simple and secure way to move files from one place or another.. tar -cf - ./files.txt ./orDir/ | ssh host "(cd /dest/dir; tar -xf -)" Given that ssh it so ubiquitous I think this will always be my go to.

> tar -cf - ./files.txt ./orDir/ | ssh host "(cd /dest/dir; tar -xf -)"

You should use '&&' instead of ';' on the host side. That way you don't accidentally dump your transfer contents into a wrong directory if the existing host dir doesn't exist.

e.g.: tar cf - stuff | ssh host "(cd /dest/dir && tar xf -)"

Re: Transfer.sh – File sharing from the command line

#66
post #40

I like it! But for me ssh already provides a simple and secure way to move files from one place or another.. tar -cf - ./files.txt ./orDir/ | ssh host "(cd /dest/dir; tar -xf -)" Given that ssh it so ubiquitous I think this will always be my go to.

> ssh already provides a simple way

:-D

> tar -cf - ./files.txt ./orDir/ | ssh host "(cd /dest/dir; tar -xf -)"

:-O

Re: Transfer.sh – File sharing from the command line

#68

Earlier quoted context omitted.

I love magic wormhole, you give the recipient three words and a number and the file is sent peer-to-peer. No messing about with routing or anything.

How is it for getting around weird networks (double NAT, etc)?

> The library depends upon a “rendezvous server”, which is a service (on a public IP address) that delivers small encrypted messages from one client to the other. This must be the same for both clients, and is generally baked-in to the application source code or default config.

> This library includes the URL of a public rendezvous server run by the author. Application developers can use this one, or they can run their own (see the https://github.com/warner/magic-wormhole-mailbox-server repository)

> For now, bulk data is sent through a “Transit” object, which does not use the Rendezvous Server. Instead, it tries to establish a direct TCP connection from sender to recipient (or vice versa). If that fails, both sides connect to a “Transit Relay”, a very simple Server that just glues two TCP sockets together when asked.

If I understand the docs correctly, it always uses a centralized server to establish the transfer. Once the transfer is established, it'll attempt to transfer the files directly, if possible, but if not, it'll fall back to using a relay.

And so many people are trapped behind NAT these days, I don't know that the need for this will be all that unusual.

Re: Transfer.sh – File sharing from the command line

#69
post #50
post #40

I like it! But for me ssh already provides a simple and secure way to move files from one place or another.. tar -cf - ./files.txt ./orDir/ | ssh host "(cd /dest/dir; tar -xf -)" Given that ssh it so ubiquitous I think this will always be my go to.

If you can trust to have gnu tar on both side, you can reduce typing. I usually do: tar c files.txt orDir | ssh -C host tar x -C /dest/dir

What about just typing rsync -havz --progress source destination?

-h for human-readable numbers -a for archive mode -v and --progress for verbose info -z for compression during transfer

Add a -n for a dry run if required.

https://linux.die.net/man/1/rsync

One of the people who came up with it - Andrew Tridgell - was more or less "responsible" for Linux and BitKeeper parting ways, which in turn ultimately lead to the creation of Git. I think it's a fascinating story. Excellent tools.

The progress / speed display is the main thing that keeps me coming back to rsync even though other tools might manage the same job - not seeing the progress of a copy is what had me searching for that solution in the very first place.

Re: Transfer.sh – File sharing from the command line

#70
post #40

I like it! But for me ssh already provides a simple and secure way to move files from one place or another.. tar -cf - ./files.txt ./orDir/ | ssh host "(cd /dest/dir; tar -xf -)" Given that ssh it so ubiquitous I think this will always be my go to.

> tar -cf - ./files.txt ./orDir/ | ssh host "(cd /dest/dir; tar -xf -)" You should use '&&' instead of ';' on the host side. That way you don't accidentally dump your transfer contents into a wrong directory if the existing host dir doesn't exist. e.g.: tar cf - stuff | ssh host "(cd /dest/dir && tar xf -)"

Or just skip the shell entirely:

  tar -C /dest/dir -xf -
Post reply on HN