How to compare the content of a tarball with a folder

前端 未结 5 1456
旧时难觅i
旧时难觅i 2021-02-05 04:44

How can I compare a tar file (already compressed) of the original folder with the original folder?

First I created archive file using

tar -         


        
5条回答
  •  南旧
    南旧 (楼主)
    2021-02-05 05:32

    --compare (-d) is more handy for that.

    tar --compare --file=archive-file.tar
    

    works if archive-file.tar is in the directory it was created. To compare archive-file.tar against a remote target (eg if you have moved archive-file.tar to /some/where/) use the -C parameter:

    tar --compare --file=archive-file.tar -C /some/where/
    

    If you want to see tar working, use -v without -v only errors (missing files/folders) are reported.

    Tipp: This works with compressed tar.bz/ tar.gz archives, too.

提交回复
热议问题