Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ファイル(t1.txt、t2.txt、t3.txt)のみを含む Dir1 があるとします。ファイル名のリストを bash スクリプトでのみ取得して、Dir2 の別のファイル リストと比較できるようにするにはどうすればよいですか? rSyncを使用せずに不足しているファイルを見つける
diff -r --brief Dir1 Dir2
一方のディレクトリにファイルが含まれていて、もう一方のディレクトリには含まれていない場合など、2 つのディレクトリの違いを教えてくれます。ちなみに、Dir1 と Dir2 の両方に同じ名前のファイル ( t1.txt など) が含まれているが、内容が異なるかどうかもわかります。2 つのディレクトリ間で同じファイルは印刷されません。