tar的工作原理?

sh/bash/dash/ksh/zsh等Shell脚本
回复
tusooa
帖子: 6548
注册时间: 2008-10-31 22:12
系统: 践兔
联系:

tar的工作原理?

#1

帖子 tusooa » 2010-08-24 11:34

代码: 全选

ubuntu@ubuntu:/target/usr$ grep ^d /home/ubuntu/tar-log 
ubuntu@ubuntu:/target/usr$ ls -l
total 180
drwx------   2 root root 36864 2010-08-24 03:24 bin
drwx------ 140 root root 12288 2010-08-24 03:26 include
lrwxrwxrwx   1 root root     5 2010-08-24 03:26 lib -> lib64
drwx------   4 root root  4096 2010-08-24 03:24 lib32
drwx------  57 root root 49152 2010-08-24 03:26 lib64
drwxr-xr-x   9 root root  4096 2010-08-24 01:34 libexec
drwxr-xr-x   9 root root  4096 2010-06-22 11:30 local
drwx------   2 root root 49152 2010-08-14 09:45 lost+found
drwx------   6 root root  4096 2010-08-24 03:28 portage
drwx------   2 root root  4096 2010-08-24 03:24 sbin
drwx------ 103 root root  4096 2010-08-24 03:27 share
drwx------   3 root root  4096 2010-08-24 03:24 src
drwx------   6 root root  4096 2010-08-24 03:26 x86_64-pc-linux-gnu
ubuntu@ubuntu:/target/usr$ 
命令:

代码: 全选

cd /mnt/gentoo-usr ; ( tar -cpvv . | tar -xpC /target/usr ) | tee ~/tar-log
发现:目录的权限没有改变.
是不是先处理文件,再处理目录?
补充:的确是这样,最后才更改目录权限.

代码: 全选

] ls -ld //
回复