News for hackers. Stuff that matters.
Re:Transfer.sh – File sharing from the command line by Giroflex on Wednesday June 20, 2018 @10:31AM (#17355735)
What about good old scp?

    scp file.txt user@host:/dest/dir/
Re:Transfer.sh – File sharing from the command line by alex_young on Wednesday June 20, 2018 @10:40AM (#17355809)
Or rsync?

rsync -zvh file.txt user@host:/dest/dir/

So many ways to do this :)

Re:Transfer.sh – File sharing from the command line by coatmatter on Wednesday June 20, 2018 @11:25AM (#17356262)
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 by LukeShu on Wednesday June 20, 2018 @12:41PM (#17356981)
After all these years, I still can't keep straight when I need a trailing slash in rsync, and when I need to not have it.
Re:Transfer.sh – File sharing from the command line by coatmatter on Wednesday June 20, 2018 @07:54PM (#17360965)
If you think of it in terms of archives and whether you want to "extract" into the current directory, or a new directory within the current one; that might help.

rsync source destination will plonk the entire source directory and put it inside destination as a neat bundle.

rsync source/ destination will take the contents of source (but not the directory source itself) and plonk it in destination

I found the info page a little dry but it does describe it succintly:

    rsync -av /src/foo /dest
    rsync -av /src/foo/ /dest/foo
For some reason though, my head freaks out when it sees "foo" and "bar", but all they're saying is that it does the same thing.

If in doubt though, just chuck everything into the destination ~/temp/ or ~/asdf/ and sort it out later.

To be honest though, most of the time I just use fish shell's autosuggestions to guide me along.

Re:Transfer.sh – File sharing from the command line by zymhan on Wednesday June 20, 2018 @12:52PM (#17357074)
What if you don't have network and login access to the other person's computer?
Re:Transfer.sh – File sharing from the command line by ktm5j on Wednesday June 20, 2018 @11:55AM (#17356530)
I usually go straight to tar & ssh over scp since you can do directories where you can't with scp. But yeah, if you just have some files scp works.
Re:Transfer.sh – File sharing from the command line by mijamo on Wednesday June 20, 2018 @12:01PM (#17356596)
You can obviously send directories with scp, just use -r. Or am I missing something?
Re:Transfer.sh – File sharing from the command line by charlchi on Wednesday June 20, 2018 @02:54PM (#17358516)
Recently used it to copy half a terabyte of stuff on my home network. Unsure about the exact specification but it supported the same flags as cp as far as I could tell.
Re:Transfer.sh – File sharing from the command line by ktm5j on Thursday June 21, 2018 @04:12PM (#17368857)
Well I'll be damned.. not sure what lead me to think this.
Re:Transfer.sh – File sharing from the command line by codegeek on Wednesday June 20, 2018 @03:09PM (#17358658)
Yes -r works for copying directories. I do it all the time
Re:Transfer.sh – File sharing from the command line by LukeShu on Wednesday June 20, 2018 @12:42PM (#17356994)
scp performs very slowly with directories containing many small files; "tar|ssh tar" does fine with that.