Use the diff command to display line-by-line differences between two files. The general syntax of the diff command is:
The diff command will examine both FILE1 and FILE 2 and tell you what changes need to be made for FILE1 and FILE2 to match. Note that the diff command points to which lines need to be:
diff FILE1 FILE2
The diff command will examine both FILE1 and FILE 2 and tell you what changes need to be made for FILE1 and FILE2 to match. Note that the diff command points to which lines need to be:
- Added (a)
- Deleted (d)
- Changed (c)
- Further lines in FILE1 identified with a less than (<) symbol and lines in FILE2 with a greater than (>) symbol.
Examples:
diff file1.txt file2.txt
Output:
2c2,3< URL: www.google.com---> URL: www.google.co.uk> Email: not@here.com
The contents of both files:
cat file1.txt
Output:
Welcome to Wherever You Are!URL: www.google.comAnd
cat file2.txt
Output:
Welcome to Wherever You Are!URL: www.google.co.ukEmail: not@here.com
No comments:
Post a Comment