man > diff

๐Ÿ“› NAME

diff - compare files line by line

๐Ÿš€ Quick Reference

Use CaseCommandDescription
Compare two filesdiff file1 file2Show differences line by line (normal diff)
Unified diff with contextdiff -u file1 file2Compact format with 3 lines context
Sideโ€‘byโ€‘side comparisondiff -y file1 file2Twoโ€‘column output, easier to read
Recursive directory diffdiff -r dir1 dir2Compare all files in subdirectories
Ignore whitespacediff -w file1 file2Skip all whiteโ€‘space differences
Only report if files differdiff -q file1 file2Quiet mode, no detailed diff
Ignore casediff -i file1 file2Caseโ€‘insensitive comparison

๐Ÿ“– SYNOPSIS

diff [OPTION]... FILES

๐Ÿ“ DESCRIPTION

Compare FILES line by line.

Mandatory arguments to long options are mandatory for short options too.

These format options provide fineโ€‘grained control over the output of diff, generalizing -D/--ifdef.

๐Ÿ“ Format Specifiers

LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'.

GFMT (only) may contain:

LETTERs are as follows for new group, lower case for old group:

%(A=B?T:E) if A equals B then T else E

LFMT (only) may contain:

Both GFMT and LFMT may contain:

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.

๐Ÿšช Exit Codes

CodeMeaning
0Inputs are identical
1Inputs are different
2Trouble (e.g., file not found, invalid option)

๐Ÿ‘ค AUTHOR

Written by Paul Eggert, Mike Haertel, David Hayes, Richard Stallman, and Len Tower.

๐Ÿ› REPORTING BUGS

Report bugs to: bug-diffutils AT gnu.org

GNU diffutils home page: <https://www.gnu.org/software/diffutils/>

General help using GNU software: <https://www.gnu.org/gethelp/>

ยฉ๏ธ COPYRIGHT

Copyright ยฉ 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://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.

๐Ÿ“š SEE ALSO

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

info diff

should give you access to the complete manual.

diff
๐Ÿ“› NAME ๐Ÿš€ Quick Reference ๐Ÿ“– SYNOPSIS ๐Ÿ“ DESCRIPTION
๐Ÿ“ Format Specifiers
๐Ÿšช Exit Codes ๐Ÿ‘ค AUTHOR ๐Ÿ› REPORTING BUGS ยฉ๏ธ COPYRIGHT ๐Ÿ“š SEE ALSO

Generated by phpman v4.9.22-1-g1b0fcb4 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-05 04:50 @216.73.216.52
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-pro / taotoken.net / www.chedong.com - original format

^_top_^