compare contents of two directories on remote server using unix

You can use rsync with the -n flag to find out if the files are in sync, without actually doing a sync. For example, from server1: rsync -n -avrc /abc/home/sample1/* server2:/abc/home/sample2/ This will print the names of all files (recursive, with the -r flag) that differ between server1:/abc/home/sample1/ and server2:/abc/home/sample2/ rsync used parameters explanation -n, … Read more

Forcing vimdiff to wrap lines?

I use the following: autocmd FilterWritePre * if &diff | setlocal wrap< | endif FilterWritePre is triggered immediately before a generated diff is written to the buffer, and setlocal wrap< copies the global value of wrap. Of course it’s also possible to simply force setlocal wrap.

use vimdiff with a diff file

Instead of using /usr/bin/vimdiff command, try this: $ vim file :vertical diffpatch path/to/diff (:vert diffpa for short.) This is equivalent to calling vimdiff on the original file and the subsequently patched file, but vim calls patch on a temporary file for you. Edit If you want vim‘s diff-mode to be entered automatically, use this: $ … Read more