Sunday, March 04, 2007

Compare Files and Directories

Here are two commands used for file and directory comparisons. Diff is for files and dircmp is for directories. Personally, I routinely use the diff command to compare files. Here are examples of their use.

Compare two files
# diff file1 file2

Show file differences a screenful at a time if output is greater than a screen
#diff files1 files2 | pg

Compare two directories
#dircmp dir1 dir2

No comments: