I wanted to be clever and compare a remote file to a local file without first manually downloading it. I can get the contents of the remote file by
ssh user@remote-host "cat path/file.name"
However, piping that to diff
ssh user@remote-host "cat path/file.name" | diff path/file.name
gives me this:
diff: missing operand after `path/file.nae'
diff: Try `diff --help' for more information.
I have ssh keys set up, so it's not prompting me for a password. What's a workaround for this?
-
), you can use/dev/stdin
. e.g.diff file1 /dev/stdin
– ctrl-alt-delor Mar 15 '17 at 19:46