- Compare files:diff [file1] [file2]- Compare files, ignoring white spaces:diff -w [file1] [file2]- Compare files, showing differences side by side:diff -y [file1] [file2]- Compare directories recursively:diff -r [directory1] [directory2]- Compare directories, only showing the names of files that differ:diff -rq [directory1] [directory2]
diff [OPTION]... FILES
Compare FILES line by line.
Mandatory arguments to long options are mandatory for short options too.
FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'. If --from-file or --to-file is given, there are no restrictions on FILE(s). If a FILE is '-', read standard input. Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
Written by Paul Eggert, Mike Haertel, David Hayes, Richard Stallman, and Len Tower.
Report bugs to: firstname.lastname@example.org GNU diffutils home page: <http://www.gnu.org/software/diffutils/> General help using GNU software: <http://www.gnu.org/gethelp/>
Copyright © 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
wdiff(1), cmp(1), diff3(1), sdiff(1), patch(1)
The full documentation for diff is maintained as a Texinfo manual. If the info and diff programs are properly installed at your site, the command
should give you access to the complete manual.