WenRou's Blog

新浪微薄腾讯微薄

最新碎语:测试图片碎语哦

您的位置:WenRou's Blog >lnamp> centos 打包、压缩、解压缩

centos 打包、压缩、解压缩

一、压缩
整个打包并压缩   tar -zcvf sama233.tar.gz /home/ftp/sama233/wwwroot

剔除打包目录中的某个子目录或文件:
比如你想打包/home这个目录,但是/home/afish/目录和/home/www/afish.php文件你都不想打包,方法是:
tar -zcvf home.tar.gz  /home --exclude=/home/afish  --exclude=/home/www/afish.php

注意:
1、--exclude=file1 而不是 --exclude file1
2、要排除一个目录是 --exclude=dir1,而不是 --exclude=dir1/

 二、解压:
解压到当前目录下
tar -zxvf shop.tar.gz
解包解压缩   tar -zxvf aini365.tar.gz /home/wwwroot/my_lnmp/domain/aini365/web
注意:
tar -xvf  这个只是解包,加上Z才算解压缩)

---

转载请注明本文标题和链接:《centos 打包、压缩、解压缩

分享到:

发表评论

13 + 2 =
路人甲 表情
看不清楚?点图切换 Ctrl+Enter快速提交