DIFF3(1)

๐Ÿ’– diff3(1) โ€” the girlies' guide to three-way file comparison ๐Ÿ’–

okay so bestie, welcome to diff3, a real one from the User Commands section of the manual. this is the tool you call when you've got three versions of the same file and you need to know who changed what. no cap, it's iconic. ๐Ÿ’…


โœจ NAME โœจ

diff3 โ€” compare three files line by line ๐Ÿฆ‹


๐ŸŒธ SYNOPSIS ๐ŸŒธ

diff3 [OPTION]... MYFILE OLDFILE YOURFILE

๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

okay so the whole vibe is: you feed it three files, it compares them line by line. that's the entire job. simple. slay. โญ

also, real talk: mandatory arguments to long options are mandatory for short options too. meaning if a long option needs a value, its short twin needs one too. periodt. ๐ŸŽ€


โœจ OPTIONS โœจ (the whole menu, bestie, nothing skipped)

  • -A, --show-all โ€” spits out all the changes, and wraps the conflicts in brackets so you can spot them ๐Ÿ‘€
  • -e, --ed โ€” outputs an ed script that folds the changes going from OLDFILE to YOURFILE straight into MYFILE
  • -E, --show-overlap โ€” literally like -e, except it brackets the conflicts ๐Ÿ’€
  • -3, --easy-only โ€” like -e, but only incorporates the changes that don't overlap. easy mode fr fr
  • -x, --overlap-only โ€” like -e, but only incorporates the changes that do overlap
  • -X โ€” like -x, but it brackets conflicts
  • -i โ€” appends w and q commands onto the ed scripts
  • -m, --merge โ€” outputs the actual merged file, and it behaves according to -A if you didn't give it any other options
  • -a, --text โ€” treats all the files as text, no matter what they look like
  • --strip-trailing-cr โ€” strips the trailing carriage return off the input
  • -T, --initial-tab โ€” makes tabs line up by prepending a tab
  • --diff-program=PROGRAM โ€” uses PROGRAM to compare the files
  • -L, --label=LABEL โ€” uses LABEL instead of the file name (you can repeat this up to three times)
  • --help โ€” displays this help and dips out
  • -v, --version โ€” outputs version info and dips out

๐Ÿฆ‹ the output formats, explained ๐Ÿฆ‹

so by default, the output format is a somewhat human-readable representation of the changes. that's the default vibe, that's what you get if you ask for nothing. โœจ

the -e, -E, -x, -X options โ€” and their long-option twins โ€” make it output an ed script instead of that default. iykyk.

and finally, the -m (--merge) option makes diff3 do the merge internally and output the actual merged file. for unusual input, this is more robust than using ed. lowkey a glow-up. ๐Ÿ‘‘


๐Ÿ™ˆ the fine print, don't skip it ๐Ÿ™ˆ

if a FILE is -, it reads from standard input. bestie please remember this one.

exit status is:

  • 0 โ€” if successful ๐Ÿซถ
  • 1 โ€” if conflicts ๐Ÿ˜ญ
  • 2 โ€” if trouble ๐Ÿ’€

โญ AUTHOR โญ

Written by Randy Smith. king behavior, honestly.


๐Ÿ“ฎ REPORTING BUGS ๐Ÿ“ฎ

found a bug? don't be shy, tell the maintainers:


Copyright ยฉ 2025 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 ๐Ÿ‘‘

cmp(1), diff(1), sdiff(1)

the full documentation for diff3 is maintained as a Texinfo manual. if the info and diff3 programs are properly installed at your site, the command

info diff3

should give you access to the complete manual. go read it, it's giving scholar. ๐Ÿ“šโœจ


and that's the whole page, bestie ๐ŸŽ€ this one came from diffutils 3.12, dated April 2025 โ€” mwah, sending you off with that footer energy. bye bestie, go merge something ๐Ÿ’–๐Ÿฆ‹๐ŸŒธ