Skip to content
EntityQ300901· pop 28· linked from 302 articles

두 개의 파일 간 차이에 대한 정보를 출력하는 파일 비교 유틸리티

Key facts

Software.name
diff
Software.title
diff
Software.author
Douglas McIlroy(AT&T Bell Laboratories)
Software.developer
Various open-source and commercial developers
Software.programming language
C
Software.operating system
Unix, Unix-like, V, Plan 9, Inferno
Software.platform
Cross-platform
Software.genre
Command
Software.license
Plan 9: MIT License

via Wikipedia infobox

Described at

The diff utility shall compare the contents of file1 and file2 and write to standard output a list of changes necessary to convert file1 into file2 . This list should be minimal. No output shall be produced if the files are identical. Produce output in a form that provides three lines of copied context. Apply diff recursively to files and directories of the same name when file1 and file2 are both directories. The diff utility shall detect infinite loops; that is, entering a previously visited directory that is an ancestor of the last file encountered. When it detects an infinite loop, diff shall write a diagnostic message to standard error and shall either recover its position in the hierarchy or terminate. Produce output in a form that provides three lines of unified context. If both file1 and file2 are directories, diff shall not compare block special files, character special files, or FIFO special files to any files and shall not compare regular files to directories. Further details are as specified in Diff Directory Comparison Format . The behavior of diff on other file types is implementation-defined when found in directories. The standard input shall be used only if one of the file1 or file2 operands references standard input. See the INPUT FILES section. Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files). Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error and informative messages written to standard output. Determine the locale for affecting the format of file timestamps written with the -C and -c options. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( If both file1 and file2 are directories, the following output formats shall be used. For each file common to the two directories, if the two files are not to be compared: if the two files have the same device ID and file serial number, or are both block special files that refer to the same device, or are both character special files that refer to the same device, in the POSIX locale the output format is unspecified. Otherwise, in the POSIX locale an unspecified format shall be used that contains the pathnames of the two files. For each file common to the two directories, if the files are compared and are identical, no output shall be written. If the two files differ, the following format is written: All directory pathnames listed in this section shall be relative to the original command line arguments. All other names of files listed in this section shall be filenames (pathname components). In the POSIX locale, if one or both of the files being compared are not text files, it is implementation-defined whether diff uses the binary file output format or the other formats as specified below. The binary file output format shall contain the pathnames of two files being compared and the string "differ". If both files being compared are text files, depending on the options specified, one of the following formats shall be used to write the differences. 3. The form used for ranges of line numbers is -separated, rather than -separated. With the -c or -C option, the output format shall consist of affected lines along with surrounding lines of context. The affected lines shall show which ones need to be deleted or changed in file1 , and those added from file2 . With the -c option, three lines of context, if available, shall be written before and after the a

Excerpt from a page describing this subject · 28,166 chars · not written by Vinony

Wikidata facts

Show 2 more facts
has command line option
U
Sources (2)

via Wikidata · CC0

Connections

Categories