in case.-L or--paginate the results to the PR program for paging.-N or--rcs displays the comparison results in RCS format.-N or--new-file when comparing directories, if file a only appears in a directory, the preset will display: Only in directory: file A If you use the-n parameter, diff will compare file A with a blank file.-P If the file is compared to a C language code file, the name of the function whe
The diff command is a very important tool on Linux to compare the contents of a file, especially to compare two different versions of a file to find where it was changed. Diff prints changes to each row on the command line. The latest version of diff also supports binary files. The diff program's output is called a pat
in the GNU patch implementation. This format is used for linux kernels released in the form of patches.In addition, there are other less-used formats, such as the Normal format, side-by-side comparison mode (side-by-side), ed script and RCS script Mode.. In addition to the side-by-side comparison mode, you can easily observe file differences. Most of the other formats are to be compatible with the old patch format.Ii. Usage of tools1. diff usageDiff
.
Binary File Description: binary files can be stored in the patch file in the original way. Diff can be generated (added with the-A option), and patch can also be identified. If you think such a patch file is too ugly, one of the solutions is to use uencode to process the binary file.
Diff compares two text files (or directories) in the unit of behavior and
Transferred from: http://www.cnblogs.com/peida/archive/2012/12/12/2814048.htmlThe diff command is a very important tool on Linux to compare the contents of a file, especially to compare two different versions of files to find the changes. Diff prints each line's changes on the command line. The latest version of diff also supports binary files. The output of the
The diff command is a very important tool on Linux to compare the contents of a file, especially to compare two different versions of files to find the changes. Diff prints each line's changes on the command line. The latest version of diff also supports binary files. The output of the diff program is called Patch, bec
one directory.
Command parameters:
-Y or -- side-by-side displays Similarities and Differences of files in parallel.
-W or -- width specifies the column width when the-y parameter is used.
-C: display all internal text and mark the differences.
-U,-U, or -- uniied = are combined to display different file content.
-R or -- recursive compares files in the subdirectory.
-N or -- new-file when comparing directories, if file A Only appears in A directory,
be deleted
+ This is a line that has been changed
Is the added row
This is a line that will be unchanged
If there is no "-" or "signature", it means that the row does not change because both after.txtand before.txt have this line.
+ This is a line that has been added
Is the added row
The unified format comparison and output of diff are performed in order.
4) use the diff command in the dire
-files can accelerate the speed of large files. -L or -- ignore-matching-lines. if the two files are in different lines, these lines both contain the character or string specified in the option, the differences between the two files are not displayed. -I or -- ignore-case do not check the case sensitivity. Www.2cto.com-l or -- paginate submit the results to the pr program for paging. -N or -- rcs: The comparison result is displayed in the format of RCS. -N or -- new-file when comparing
. > Ulg
Diff can be followed by two file names or two directory names. If it is a directory name and a file name, it only applies to files with the same name under that directory. Dr _
Oldlinux forum-a Forum on Early Linux kernel code development. SQ ~ +
If there are two directories, they act on all the files under the directory without recursion. If we want Recursive Execution, we need to use the-R paramet
apply what you have learned on a daily basis to promote learning.First, describe diff and patch. All options in the man online document will not be described here, which is unnecessary. In the 99% period, we only use a few options. Therefore, you must learn these options.1. Diff--------------------NameDiff-find differences between two filesSynopsisDiff [Options] From-file to-file--------------------Simply
submit the results to the pr program for paging. -N or -- rcs: The comparison result is displayed in the format of RCS. -N or -- new-file when comparing directories, if file A Only appears in A directory, the default is: Only in Directory: If file A uses the-N parameter, then, diff compares file A with A blank file. -P: If the comparison file is a C program code file, the function name of the difference is
/workspace/searchserver/webcontent/WEB-INF/Web. xml 11:22:45. 000000000 + 0800@-+ @@+ -+ 2. parameters used in the diff directoryIf two directories are compared, use-R to indicate recursively compare any subdirectories found.-X to exclude a file in the directory.Other ** 3. Other parameters-A treat all files as text.-B ignore changes in the amount of white space.-N if a file appears in only one directory, i
Linux Tour (1): diff, Patch and quilt (bottom) 2 quiltOur own projects can manage all the code with CVS or SVN. But sometimes we use projects that other developers maintain. We need to change some files, but we cannot submit the code directly to the version number management tool. It is inappropriate to rebuild the entire project with version number management tools, because most of the code is maintained by others, such as the Linux kernel. We just w
line that has been changedIs the added rowThis is a line that will be unchangedIf there is no "-" or "signature", it means that the row does not change because both after.txtand before.txt have this line.+ This is a line that has been addedIs the added rowThe unified format comparison and output of diff are performed in order.
4) use the diff command in the directory.
Create the old and new
option, the differences between the two files are not displayed. -I. or--ignore- Casedoes not check for differences in case. -L OR--Paginate The results to the PR program for paging. -N OR--RCS Displays the comparison results in the form of RCS. -N or--new-fileWhen comparing directories, if file a only appears in a directory, the preset will display: Only in directory: file a If used-n parameter, diff comp
command to convert Filel into file2. The line numbers (N1,N2) before the letters (a, D, and C) are for file1, and the following line numbers (N3,N4) are for file2. The letters A, D, and C represent additional, delete, and modify actions, respectively.After each line in the above form follows a number of rows that are affected, the line that begins with "" is the first file, and the line that begins with "" is the second file.Diff can distinguish between block and character device files and FIFO
The diff command compares two files and folders, and if you compare two files, two files are compared by line, and if you compare the directories, diff compares the files with the same name under two files, lists the different binaries, common subdirectories, and files that appear only in one directory.Example 1 where 1c1 represents the first row, and C means tha
you do not have a working copy on this computer, you can compare the revision of the repository by simply entering the appropriate URL on the command line:$ svn diff-c 5 http://svn.example.com/repos/example/trunk/text/rules.txt ...Browse the RepositoryWith SVN cat and SVN list, you can view the contents of files and directories without modifying the work revisions, and you don't even need to have a working
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.