压缩与解压

tar 加密压缩解压

加密压缩

tar zcvf - file | openssl des3 -salt -k secretpassword -out /path/to/file.tar.gz
# 使用dd
tar zcvf - file | openssl des3 -salt -k secretpassword | dd of=/path/to/file.tar.gz

解密解压

openssl des3 -d -k secretpassword -salt -in /path/to/file.tar.gz | tar xf -
# 使用dd
dd if=/path/to/file.tar.gz |openssl des3 -d -k secretpassword|tar xf -

不解压查看tar包内容

  1. file.tar.gz

    gzip -dc file.tar.gz | tar tvf -

  2. file.tar.bz2

    bzip2 -dc file.tar.bz2 |tar tvf -

  3. file.tar

    tar tvf file.tar