Re:Deprecating scp
by edgyquant on Friday November 06, 2020 @01:16PM
(#25009811)
I’ve also used
Quite a bit
[ Parent
| on HN ]
There's something a little badass about using dd to transfer a file to a remote system.
I was transferring files to an Android device, and adb push wasn't working for some reason. It would hit an error and kill the adb connection until I re-plugged the USB.
Somehow this worked:
dd if=foo | adb shell dd of=/storage/.../fooEverything is a file!
Ah yes, that one too. Used it a couple of times straight with a /dev/sda to best effort salvage data from a broken but running remote system I knew would not reboot as is.
Re:Deprecating scp
by a1369209993 on Friday November 06, 2020 @03:29PM
(#25010830)
Huh, pleasantly surprised to learn that dd correctly handles the truncated final block of a not-multiple-of-512-byte file; could have sworn that didn't work at some point.
SUS specifies that dd should do the "right thing" with input with non-integer number of blocks input, that is pad it with zeros if conv=sync, just pass through shorter otherwise.
Re:Deprecating scp
by a1369209993 on Saturday November 07, 2020 @12:36PM
(#25016627)
> SUS specifies that dd should do the "right thing"
A example the C standard could stand to learn from, then.
Why not just
cat file | ssh user@host 'cat >file'
ssh user@host cat file | cat >file
?PS.
I use mc to copy: F5, Enter.