一、tar壓縮與解壓縮文件
1、tar壓縮文件
將test_file文件夾下面的文件全部壓縮:
tar -zcvf test_file.tar.gz test_file/
2、tar解壓縮文件
tar -zxvf test.tgz
二、zip壓縮與解壓縮文件
1、把 test 壓縮文件夾為 test.zip 文件
zip -r test.zip test
2、把 test.zip 解壓到 test 目錄里面
unzip test.zip -d test
3、把 test 文件夾和 test.txt壓縮成為 test.zip
zip test.zip test test.txt
4、直接解壓 test.zip文件
unzip test.zip
5、查看 test.zip文件里面的內容
unzip -v test.zip
上述命令均可行。
以上。