代码: 全选
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
是不是先处理文件,再处理目录?
补充:的确是这样,最后才更改目录权限.