
Linux に 2 つのディレクトリがある場合、これらのディレクトリの内容の違いをどのように確認できますか?
今私はこのコマンドを使います:
diff <(ls -d dir1/*) <(ls -d dir2/*)
他に何かアイデアはありますか?
答え1
diff
ディレクトリ自体に使用しないのはなぜですか?
$ tree
.
|-- test1
| |-- bar
| `-- foo
`-- test2
|-- baz
`-- foo
結果:
$差分 テスト1 テスト2 テスト1のみ: バー テスト2のみ: baz