O'Reilly logo

A Practical Guide to Red Hat® Linux® 8 by Mark G. Sobell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required