![]() Changes that lie within the specified context lines of each other are grouped together as output. Lines changed from one file to the other are marked in both files with an ! (exclamation point). The lines removed from File1 are marked with a - (minus sign ) and those added to File2 are marked with a + (plus sign). Each change is separated by a line with a dozen * (asterisks). The output begins with identification of the files involved and their creation dates. The -C flag modifies the output slightly. ![]() Produces a diff command comparison with a number of lines of context equal to the value specified by the Lines variable. Flags -bĬauses any amount of white space at the end of a line to be treated as a single newline character (the white-space characters preceding the newline character are ignored) and other strings of white-space characters, not including newline characters, to compare equally. The system does not issue an error message. Note: If more than one of the -c, -C, -D, -e, -f, or -n flags are specified, the last one on the command line takes precedence. ![]() As in the ed command, identical pairs (where Number1 = Number2) are abbreviated as a single number.įollowing each of these lines, the diff command displays all lines affected in the first file preceded by a (greater than sign).Īn exit value of 0 indicates no differences, 1 indicates differences found, and 2 indicates an error. Thus, by exchanging a for d and reading from right to left, you can also tell how to convert File2 into File1. The numbers before the action letters pertain to File1 those after pertain to File2. These lines resemble ed subcommands to convert File1 into File2. The normal output contains lines of these forms: Lines Affected in File1 Action Lines Affected in File2 If the File1 parameter is a directory, then a file in that directory whose file name is the same as the File2 parameter is used. If neither the File1 nor File2 parameter is a directory, then either may be given as - (minus sign), in which case the standard input is used. When the diff command is run on regular files, and when comparing text files that differ during directory comparison, the diff command tells what lines must be changed in the files to make them agree. Binary files that differ, common subdirectories, and files that appear in only one directory are listed. If the Directory1 and Directory2 parameters are specified, the diff command compares the text files that have the same name in both directories. Note: The diff command only works with input files that are text files. It can compare single files or the contents of directories. Syntax To Compare the Contents of Two Filesĭiff | -e | -f | -n ] ĭiff To Sort the Contents of Directories and Compare Files That Are Differentĭiff Directory1 Directory2ĭiff Directory1 Directory2 Description AIX Version 4.3 Commands Reference, Volume 2Ĭompares text files.
0 Comments
Leave a Reply. |