@
mikeguan @
GTim @
billlee root@DR02:/tmp# ls -l /home/root/test/
-rw-r--r-- 1 root root 0 Jan 1 00:09 1
-rw-r--r-- 1 root root 0 Jan 1 00:10 1.1
-rw-r--r-- 1 root root 0 Jan 1 00:10 1.2
-rw-r--r-- 1 root root 0 Jan 1 00:10 1.3
-rw-r--r-- 1 root root 0 Jan 1 00:10 1.4
-rw-r--r-- 1 root root 0 Jan 1 00:09 2
-rw-r--r-- 1 root root 0 Jan 1 00:09 3
-rw-r--r-- 1 root root 0 Jan 1 00:09 4
root@DR02:/tmp# tar -zcvf test.tar.gz -C /home/root/ test/1.*
tar: test/1.*: No such file or directory
tar: error exit delayed from previous errors
感觉像是在解析语义的时候出现了问题,如果在压缩时不使用-C:
root@DR02:/tmp# tar -zcvf test.tar.gz /home/root/test/1.*
tar: removing leading '/' from member names
home/root/test/1.1
home/root/test/1.2
home/root/test/1.3
home/root/test/1.4
虽然在压缩的时候我没见过有人用-C,但是还是很奇怪!