diff
Displays the differences between two files
diff [options] file1 file2
diff [options] file1 directory
diff [options] directory file2
diff [options] directory1 directory2
The diff utility displays line-by-line differences between two files. By default diff displays the differences as instructions that you can use to edit one of the files to make it the same as the other.
Arguments
The file1 and file2 are pathnames of the files that diff works on. When the directory2 argument is used in place of file2, diff looks for a file in directory2 with the same name as file1. Similarly, when the directory argument is used in place of file1, diff looks for a file in directory1 with the same name as file2. You can use a hyphen in place of file1 or
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access