How to show the difference between two files? Unix Command: diff filename filename2 This command will compare the contents of two files and will tell you exactly what and where the differences between them are. For example, perhaps you created a file then later went back and edited that file and saved it under a new name. Now you need to review exactly what changes you made. The order of your output will be contingent upon which filename you enter first in the command line. The line(s) from the first file listed are marked by a < while the line(s) from the second file are indicated by the > symbol. The numbers given to you correspond to the line numbers where the differences can be located. In the following example, a difference appears on line 4, an extra line appears in the second file (line 5). Then another difference between corresponding lines is found between line 8 in the first file and line 9 in the second file. NOTE: Because of the extra line in the second file (line 5) the numbering has become incongruent. % diff test1.sps test2.sps 4c4,5
> crosstabs income by race 8c9
Have a Unix Problem
Unix Books :-
Return to : - Unix System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|