一般情况下,要在 Linux 下比较两个文件,我们会使用 diff (一个简单的源自 Unix 的命令行工具)来显示两个计算机文件的不同;它一行一行的去比较文件,而且很方便使用,在几乎全部的 Linux 发行版都预装了。

问题是在 Linux 下我们怎么才能比较两个目录?现在,我们想知道两个目录中哪些文件/子目录是共有的,哪些只存在一个于目录。

运行 diff常规的语法如下:

$ diff [OPTION]… FILES
$ diff options dir1 dir2

默认情况下,输出是按文件/子文件夹的文件名的字母排序的,如下面截图所示,在命令中, -q 开关是告诉 diif 只有在文件有差异时报告。

$ diff -q directory-1/ directory-2/

Linux Diff

两个文件夹之间的差异

再次运行 diff 并不能进入子文件夹,但是我们可以使用 -r 开关来读子文件夹,如下所示。

$ diff -qr directory-1/ directory-2/

使用 Meld 可视化比较和合并工具

meld 是一个很酷的图形化工具(一个 GNOME 桌面下的可视化的比较和合并工具),可供那些喜欢使用鼠标的人使用,可按如下来安装。

$ sudo apt install meld  [Debian/Ubuntu systems]
$ sudo yum install meld  [RHEL/CentOS systems]
$ sudo dnf install meld  [Fedora 22+]

一旦你安装了它之后,在 Ubuntu Dash 或者 Linux Mint 菜单搜索 “meld” ,或者 FedoraCentOS 桌面的 Activities Overview,然后启动它。

你可以看到如下的 Meld 界面,可以选择文件或者文件夹来比较,此外还有版本控制视图。点击目录比较并移动到下个界面。

Linux Meld

Meld 比较工具

选择你想要比较的文件夹,注意你可以勾选 “3-way Comparison” 选项,添加第三个文件夹。

Linux Meld 3 way

选择比较的文件夹 选择好要比较的文件夹后,点击 “Compare”。

Linux Meld 2 directories

文件夹不同列表 在这篇文章中,我们描述了怎么在 Linux 下找到两个文件夹的不同。如果你知道其他的命令或者图形界面工具,不要忘记在下方评论分享你们的想法。

QT5.5.1 for VxWorks

"I am pleased to announce that we have now released fully supported Qt 5.5.1 for VxWorks 7 Real Time Operating System (RTOS). Older version of VxWorks has been supported with Qt 4.8, but the port has now been updated to Qt 5.5 and a new major version of VxWorks. With the new version released today it is possible to run the Qt 5 goodies such as OpenGL accelerated Qt Quick 2 on top of VxWorks 7. The release is available for all existing Qt for VxWorks licensses as a new downloadable item in the Qt Account."

The goal of the new port is to provide a similar level of Qt functionality as the earlier Qt 4.8 port does, as well as to take advantage of the great graphics capabilities of Qt 5. In addition, Qt Creator IDE has integrated support for VxWorks, and deployment of a Qt application to a development hardware running VxWorks is accomplished with a single click. VxWorks development with Qt 5 can be done using both Windows and Linux development hosts.

The new Qt 5.5 port for VxWorks 7 supports most of the essential Qt modules:

  • Qt Core
  • Qt GUI
  • Qt Network
  • Qt Multimedia (audio output only)
  • Qt QML
  • Qt Quick
  • Qt Quick Controls
  • Qt Quick Dialogs
  • Qt Quick Layouts
  • Qt SQL
  • Qt Test
  • Qt Widgets

In addition to these, the following add-ons are supported:

  • Qt Quick Compiler
  • Qt Charts
  • Qt Data Visualization
  • Qt Virtual Keyboard
  • Qt Concurrent
  • Qt Graphical Effects
  • Qt Image Formats
  • Qt OpenGL (only for porting form Qt 4, new applications should use OpenGL support in Qt GUI)
  • Qt Platform Headers
  • Qt SVG
  • Qt XML Patterns

The new Qt 5.5 port requires VxWorks 7. We have used Freescale i.MX6 as the reference hardware for the Qt 5.5 for VxWorks port. Multiple other CPUs are supported by VxWorks 7 and most of the x86 and ARM based CPUs with OpenGL support are possible to be enabled for the Qt port with an additional effort.

Holders of a valid Qt for VxWorks license can download the new release from their Qt Account web portal and run it on top of the December 15th GA release of VxWorks 7 RTOS.