When we write code, we often need to know the differences between two files, or between different versions of the same file. There is a very powerful tool called BeyondCompare under Windows, but what tool do we need to use under Linux? This article introduces 9 commonly used code comparison tools under Linux, including not only command line tools but also GUI interface tools, allowing you to easily perform code comparison. 1. diff Command The The diff command is pre-installed in most Linux distributions. It can compare two text files line by line and output their differences. For more information, please refer to its man page. $ man diff However, although the diff command is powerful, its output is too touching, not intuitive or clear. Therefore, in order to make up for this shortcoming, some experts developed more powerful tools based on diff. Two are recommended here: colordiff Command You can install colordiff on your computer by yourself, using different installation commands depending on the distribution. $ yum install colordiff [On CentOS/RHEL/Fedora] $ dnf install colordiff [On Fedora 23+ version] $ sudo apt-get install colordiff [On Debian/Ubuntu/Mint] Similarly, you can use the man command to view its help documentation: $ man colordiff wdiff Command The diff command compares differences line by line, while The installation command is as follows: $ yum install wdiff [On CentOS/RHEL/Fedora] $ dnf install wdiff [On Fedora 23+ version] $ sudo apt-get install wdiff [On Debian/Ubuntu/Mint] For more details, see its man page. $ man wdiff 2. vimdiff Command This command is usually followed by two or more file names as parameters. These files will be opened in the split windows of the Vim editor at the same time, and the parts with different contents in the files will be highlighted. Its Chinese homepage is: http://vimcdoc.sourceforge.net/doc/diff.html The two tools introduced above are Linux command line comparison tools. Let's take a look at some GUI comparison tools. 3. Kompare Kompare features are as follows:
The homepage of the tool is: https://www.kde.org/applications/development/kompare/ 4. DiffMerge DiffMerge has two major functions: 1. Graphically display the changes between two files. Includes internal line highlighting and full editing support. 2. Graphically display the changes between the three files. Allows automatic merging (when safe to do so) and full editing control over the resulting file. It has the following features:
The homepage of the tool is: https://sourcegear.com/diffmerge/ 5. Meld
Its official website is: http://meldmerge.org/ 6. Diffuse You can use it to view the text comparison summary and use the mouse to select a line in the file for editing. Other features include:
Its official website is: http://diffuse.sourceforge.net/ 7. XXdiff It has the following features:
8. KDiff3 It can compare or merge two or three files or directories, and has the following features:
Its official website is: http://kdiff3.sourceforge.net/ 9. TkDiff However, it also has some features that other text comparison tools do not have, such as difference bookmarks and a navigation map for quick navigation of differences. Its official website is: https://sourceforge.net/projects/tkdiff/ This concludes this article about the recommendation summary of 9 excellent code comparison tools under Linux. For more relevant Linux code comparison tool content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed analysis of GUID display issues in Mongodb
>>: Detailed installation and configuration tutorial of MySQL flashback tool binlog2sql
Abstract: Many companies, even most companies whos...
The installation tutorial of mysql5.7.17 is share...
Table of contents text LOCK parameter ALGORITHM p...
Table of contents 1. Add attributes 2. Merge mult...
Table of contents 1. Code analysis 2. Source code...
A CSS layout and style question: how to balance h...
As a commonly used database, MySQL requires a lot...
Table of contents 1. Function Binding 2. With par...
1 Cause After the project migrated the database a...
Preface vsftp is an easy-to-use and secure ftp se...
Table of contents The problem here is: Solution 1...
When developing a website, you often need to use ...
Table of contents 1. Problematic SQL statements S...
Be sure to remember to back up your data, it is p...
CSS: Copy code The code is as follows: *{margin:0;...