Linux递归比较文件夹差异

比较命令如下:

diff -Nrq a b
比较文件夹记得加上-r, 这样才可以递归所有文件夹,-q可以只输出哪些文件是不一样的,对于比较文件夹,可能这个比较有用。
不过-q输出不同的文件时,有些情况是一个文件一个文件夹下有,一个没有,但是-q输出的是2个文件不一样

结果如下:

[www@email tmp]$ diff -Nrq dist1 dist
Files dist1/index.html and dist/index.html differ
Files dist1/static/js/app.37b9219ca97a8b00d970.js and dist/static/js/app.37b9219ca97a8b00d970.js differ
Files dist1/static/js/app.37b9219ca97a8b00d970.js.map and dist/static/js/app.37b9219ca97a8b00d970.js.map differ
Files dist1/static/js/app.e9fede18b4177fc80a11.js and dist/static/js/app.e9fede18b4177fc80a11.js differ
Files dist1/static/js/app.e9fede18b4177fc80a11.js.map and dist/static/js/app.e9fede18b4177fc80a11.js.map differ
Files dist1/static/js/manifest.2ae2e69a05c33dfc65f8.js.map and dist/static/js/manifest.2ae2e69a05c33dfc65f8.js.map differ

你可能感兴趣的:(Linux)