diffコマンドでディレクトリも含めて再帰的に差分チェックをする方法

オプション [-qr] を付与すればいい。

diff -qr [dir-1] [dir-2]

以下、コマンド実行例。

[root@hoge work]# diff -qr pj.9 pj.9_1
Files pj.9/zbx_env/var/lib/mysql/binlog.000006 and pj.9_1/zbx_env/var/lib/mysql/binlog.000006 differ
Files pj.9/zbx_env/var/lib/mysql/#ib_16384_0.dblwr and pj.9_1/zbx_env/var/lib/mysql/#ib_16384_0.dblwr differ
Files pj.9/zbx_env/var/lib/mysql/ibdata1 and pj.9_1/zbx_env/var/lib/mysql/ibdata1 differ
Files pj.9/zbx_env/var/lib/mysql/ib_logfile0 and pj.9_1/zbx_env/var/lib/mysql/ib_logfile0 differ
Files pj.9/zbx_env/var/lib/mysql/ib_logfile1 and pj.9_1/zbx_env/var/lib/mysql/ib_logfile1 differ
Files pj.9/zbx_env/var/lib/mysql/mysql.ibd and pj.9_1/zbx_env/var/lib/mysql/mysql.ibd differ
Files pj.9/zbx_env/var/lib/mysql/undo_001 and pj.9_1/zbx_env/var/lib/mysql/undo_001 differ
Files pj.9/zbx_env/var/lib/mysql/undo_002 and pj.9_1/zbx_env/var/lib/mysql/undo_002 differ
Files pj.9/zbx_env/var/lib/mysql/zabbix/history.ibd and pj.9_1/zbx_env/var/lib/mysql/zabbix/history.ibd differ
Files pj.9/zbx_env/var/lib/mysql/zabbix/history_uint.ibd and pj.9_1/zbx_env/var/lib/mysql/zabbix/history_uint.ibd differ
Files pj.9/zbx_env/var/lib/mysql/zabbix/httptest.ibd and pj.9_1/zbx_env/var/lib/mysql/zabbix/httptest.ibd differ
Files pj.9/zbx_env/var/lib/mysql/zabbix/sessions.ibd and pj.9_1/zbx_env/var/lib/mysql/zabbix/sessions.ibd differ
[root@hoge work]#

Leave a Comment