怎么这样打包 文件? 内详
我想打包自己家(/home/czy)所有文件除了 tmp这个文件夹应该怎么做??怎么打包的时候 不把 tmp文件夹 算进去??
谢谢 man tar: .
.
.
Local file selection:
.
.
.
--exclude=PATTERN exclude files, given as a PATTERN
-X, --exclude-from=FILE exclude patterns listed in FILE
.
.
. 看不大懂 :oops: tryfind /home/czy -path "/home/czy/tmp" -prune -o -print -name "*"|xargs tar czvf all.tar.gz $ cd /home/czy
$ tar -czvf /your/pack.tar.gz --exclude=tmp . 感谢:) $ cd /home/czy
$ tar -czvf /your/pack.tar.gz --exclude=tmp .
should be
tar czvf /your/pack.tar.gz /your/ --exclude=tmp :P $ cd /home/czy
$ tar -czvf /your/pack.tar.gz --exclude=tmp .
should be
tar czvf /your/pack.tar.gz /your/ --exclude=tmp :P
小z,瞎说 :twisted:
1. 已经先 cd 到 ~ 了,这样可以不存储上级目录名。
2. 你没有看见最后的“点”吧? :roll:
按您的做法,人家要打包 /home/czy ,您却让人家打包 /your/ ,这个这个…… 不厚道吧 :wink: sorry to dannycat, :)
我错了,呵呵,没看仔细 :oops: zhy2111314, 又错啦 :mrgreen:
不是 sorry to me, 该是 sorry to pslist/fans, 你不会误导我可是会误导他(们)哈 :wink: sorry to all who saw this post :cry:
I was wrong......
especially for pslist and dannycat :-( 我有一次这样写
tar cvfz backup.tgz ./* --exclude=static
结果执行了半天都没有停止,原来backup.tgz放在同样的目录下面,又重复被tar了N次
晕倒。。。
你没有看见最后的“点”吧?
最后的"."有什么作用? 最后点应该表示当前目录下吧
页:
[1]