|
|
Sponsored Links
|
Maxabout.com > Tips
Comparing Two Files Or Two DirectoriesAdded on:8/22/2008 12:32:20 AM In Linux Tips Rated by 1 users
- To show all the lines that differ between file1 and file2:
diff file1 file2
- To create a patch listing the changes from version1 to version2:
diff -aur version1 version2 >dir2.diff
- To apply the patch to version1 and produce version2:
patch -p1 <dir2.diff
- For text files where the wrapping of paragraph may have changed, use 'wdiff'.
- To compare two directories:
diff -r --brief dir1 dir2
- To copy the content of dir1 into dir2 without the copying the files that already exist and are the same, use rsync:
rsync -a dir1 dir2
- If you want to copy the newest files and delete the ones (make dir2 a miror copy of dir1:)
rsync -a --delete dir1 dir2
- To synchronize two directories (in both directions), I use the program 'unison'
|
Sponsored Links
Tools
Bookmark/Discuss
|
|
|