差分ディスク使用量のみ計算

差分ディスク使用量のみ計算

2つのディレクトリ構造間で異なるファイルの合計サイズを計算できる単純なコマンドの組み合わせはありますか?

diffの出力を何とか送るつもりですが、du実際にこれを行う方法を知るほど熟練していませんでした。

一例:

/foo-a/
  bar/
   test1.txt   12 bytes   01/01/2000 12:00:00
   test2.txt   12 bytes   01/01/2000 12:00:00
   test3.txt   12 bytes   01/01/2000 12:00:00
 test4.txt   12 bytes   01/01/2000 12:00:00
 test5.txt   12 bytes   01/01/2000 12:00:00

/foo-b/
  bar/
   test1.txt   12 bytes   01/01/2000 12:00:00
   test2.txt   12 bytes   01/01/2000 12:00:05
   test3.txt   35 bytes   01/01/2000 12:00:05
 test6.txt   12 bytes   01/01/2000 12:00:00
 test7.txt   12 bytes   01/01/2000 12:00:00

上記の2つのディレクトリを比較して、次のようにbしますa

test1.txt: unchanged, same size:      0 bytes
test2.txt: changed, same size:       12 bytes
test3.txt: changed, different size:  35 bytes
test4.txt: unchanged, same size:      0 bytes
test5.txt: deleted:                   0 bytes
test6.txt: hardlink of test4.txt:     0 bytes
test7.txt: added:                    12 bytes

                           total:    59 bytes

ベストアンサー1

おすすめ記事