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.
2 つの異なる .tar.gz ファイルがある場合: 2 番目の .tar.gz は、最初の .tar.gz のサブセットです。
2 番目の .tar.gz で不足しているファイルを見つけるには、1 行のコマンドが必要です。
例えば:
1.tar.gz ファイル リスト:
1.jsp 2.txt 3.htm
2.tar.gz ファイル リスト:
1.jsp 3.htm
出力は次のようになります。
2.txt
内容をリストして実行するだけですdiff:
diff
diff <(tar -tvf 1.tar.gz | sort) <(tar -tvf 2.tar.gz | sort)