+ -
当前位置:首页 → 问答吧 → 请教linux一个压缩的问题

请教linux一个压缩的问题

时间:2011-08-26

来源:互联网

tar -zcvf /tmp/etc.tar.gz /etc
是个压缩文件的用法,但是,我现在遇到一个问题,如果我在/etc目录下有个文件夹uploadfiles 占用了很大的空间,我想压缩/etc的时候,把uploadfiles文件夹排除在外,请问,怎么写这个命令哦?

作者: liujun3512159   发布时间: 2011-08-26

楼主,用-X选项试试
 -X, --exclude-from=FILE exclude patterns listed in FILE
  --anchored exclude patterns match file name start (default)
  --no-anchored exclude patterns match after any /
  --ignore-case exclusion ignores case
  --no-ignore-case exclusion is case sensitive (default)
  --wildcards exclude patterns use wildcards (default)
  --no-wildcards exclude patterns are plain strings
  --wildcards-match-slash exclude pattern wildcards match '/' (default)
  --no-wildcards-match-slash exclude pattern wildcards do not match '/'

作者: louyong0571   发布时间: 2011-08-26

能写出来吗?给我参考下,呵呵

作者: liujun3512159   发布时间: 2011-08-26