|
Compares the contents of two text files. Displays the lines that are different. Format: diff fileordirname1 fileordirname2 Examples: diff prog1 prog2 diff prog1 /home/janet/dir1 diff /home/janet /home/janet/dir1 Compares prog1 to prog2. In the second example, compares prog1 to /home/janet/dir1/prog1 if it exists. In the third example, compares all files that exist in both directories. Displays the lines that differ between the two files. < indicates lines from the first file; > indicates lines from the second file. For example: cat fileA John Smith Alice Brown John Huang cat fileB Bob Smith Alice in Wonderland John Huang diff fileA fileB <John Smith <Alice Brown --- >Bob Smith >Alice in Wonderland
|
|