by vore · 3y ago · 0 comments
But you might not need to read them at your current location, though that consideration might be overkill for the level this article is aimed at.
For instance reading a full remote file to compare it to a local one byte-for-byte will be slower than
sha256sum some.file; ssh user@host sha256sum some.file
or cmp <(sha256sum some.file) <(ssh user@host sha256sum some.file)
unless the file is very small (in which case a simple download by HTTP(S) or read via network filesystem may be faster than negotiating a SSH connection and running the remote hash command). In either case accessing a pre-computed hash of the remote content will likely be faster than both options, assuming a stored hash exists and you are looking to verify your local copy.I try to ramp it up from a loose anology to slowly model the actual working (although I'm no expert on that!)