How to diff and merge files or directories on Linux
来源:互联网 发布:特效视频制作软件 编辑:程序博客网 时间:2024/05/16 15:54
In this tutorial, I describe how to diff and merge files and directories on Linux by using a GUI tool called Meld.
Meld is a visual diff and merge tool that can compare files, directories, and any version controlled projects. Meld offers two- and three-way diff and merge, and supports simple commands of major version control systems (e.g., SVN, Git, Mercurial, Bazaar).
Install Meld on Linux
To install Meld on Debian, Ubuntu or Linux Mint:
To install Meld on CentOS or RHEL, first enable Repoforge repository, and then run:
To install Meld on Fedora, simply run:
After installation, you can start Meld as follows.
To start a comparison, click on the comparison icon at the top. Then you can choose between file/directory comparison or version control browser modes like the following.
Compare and Merge Two Files
You can visually compare the difference between two files.
You can merge individual changes selectively in either direction, or apply all changes in one direction.
Three-Way File Comparison
You can compare three different files or directories side-by-side.
Compare and Merge Two Directories
You can compare two or three directories and apply the diff (i.e., copy or delete files) between them.
Customize Meld Filtering Rules
You can customize Meld so that it can filter out uninteresting differences. The filtering rule can be defined for files as well as directories by regular expressions as shown below.
Nautilus Integration
Meld provides Nautilus integration, so you can diff and merge files or directories directly in Nautilus file manager. To install Nautilus plugin for Meld on Ubuntu desktop, run the following commands.
$ nautilus -q
Once you have installed Nautilus plugin for Meld, you will see an additional context menu called "Compare" when you right-click two files. The following screenshots show how Meld works on Nautilus.
- How to diff and merge files or directories on Linux
- Find The Largest Top 10 Files and Directories on Linux
- How to recover deleted files on Linux
- linux 学习笔记之 Files and Directories
- List files and directories
- Files and Directories
- 4-Files and Directories
- Files and Directories
- This inspection checks references to files and directories
- rm - remove files or directories
- Linux Log Files Location And How Do I View Logs Files on Linux?
- Linux - 操作文件与目录(manipulating files and directories)
- cp - copy files and directories
- APUE-Chapter4. Files and Directories
- How to unzip or zip files content
- How to create desktop shortcut or launcher on Linux
- how to open files on MVC3 website
- How to extract .RAR files on Ubuntu
- 第二学期第八周项目1--实现复数类中的运算符重载
- HDU 4588 Count The Carries 计算二进制进位总数
- Js浮动层插件,点击按钮弹出层,可关闭
- 返回值的第二个作用
- 用TI CC2530DK开发时,用light swtich例子会遇到的一个问题和解决方案
- How to diff and merge files or directories on Linux
- Ubuntu 12.04中文输入法的安装
- 基础数位DP小结
- leetcode之Jump Game
- HDU 2838 (树状数组求逆序数)
- 关于fork 创建进程
- snprintf函数的常见功能
- 【LeetCode】Merge k Sorted Lists
- Matlab中kmeans聚类用法