把目录(文件夹)打包为gz格式的压缩包

gzip只有解压功能,没有压缩打包功能。如果想要将文件夹(目录)打包成gz格式的压缩包,需要用tar命令。

把文件夹打包为tar.gz命令: tar -zcvf 文件名.tar.gz 要压缩的文件/文件夹

例如,把webfile目录(包括里面的文件)压缩为webfile.tar.gz,命令:tar -zcvf webfile.tar.gz webfile

信息来源:

csdn论坛:https://blog.csdn.net/yual365/article/details/84956927

本论坛博主IT阿虎:https://www.cnblogs.com/ITsqh/p/11532422.html

linux教程: https://www.runoob.com/linux/linux-comm-tar.html

猜你喜欢

转载自www.cnblogs.com/laocm/p/12369529.html
今日推荐