You can use rsync in dry run mode, as suggested briefly in another answer. It lists any files that are different.
For that, use the rvnc options (r=recursive, v=verbose, n= dry-run, c=checksum). With rsync in pull mode (rsync [OPTION...] [USER@]HOST:SRC... [DEST]), an example is:
I used SFTP to the remote server and entered my username/pwd when prompted.
Then I used the dir that was created in the .gvfs dir in my home directory in the diff command.
diff -r --brief /home/user dir/.gvfs/SFTP\ on\ freenas.local/path to dir/dir1 /path to local dir/dir2
You can do it with Bash's process substitution:
Or, if both are on remote servers:
Finally I've found great solution: vimdiff
thanks to http://linux.spiney.org/remote_diff_with_vim_and_ssh see also http://www.vim.org/scripts/script.php?script_id=1075 .
If you just want to see what files are different, rather than a diff of the actual files, then you can use
rsync --dry-run
Here's another quick and dirty command line recipe. Unlike the chosen answer, it works inside of makefiles:
Use scp to bring the files to a common machine and diff them there?
Or, if you just want to know if the files are different or not, hash them with md5sum on each machine.
You could also look into something like SSHFS, but I don't know how well an algorithm like diff performs over that.
One way, if it is possible on your system would be to simply mount the remote filesystem with sshfs.
You can use
rsync
in dry run mode, as suggested briefly in another answer. It lists any files that are different.For that, use the
rvnc
options (r
=recursive,v
=verbose,n
= dry-run,c
=checksum). Withrsync
in pull mode (rsync [OPTION...] [USER@]HOST:SRC... [DEST]
), an example is:Remember, this provides no info on whether the local or remote file is newer. Just if they differ.
on your local machine, make a recursive copy of the directory you want to diff. For instance:
use rsync to replicate the remote directory over the local copy:
use diff to find difference between the local directory and the local replica of the remote one:
If you have sshfs and need to diff directories:
Here is how I did it.
I used SFTP to the remote server and entered my username/pwd when prompted. Then I used the dir that was created in the
.gvfs
dir in my home directory in the diff command.