日期:2014-05-16 浏览次数:20768 次
[root@RHEL6A tmp]# cp -r /var/mail . [root@RHEL6A tmp]# ls data1.txt data4.txt osstarttest.txt shaa.sh test data2.txt etc.tar.gz pulse-5iGMZJA28qP1 shab.sh user1_files.txt data3.txt mail pulse-l74hRhWYTOSG shac.sh virtual-root.JOp5Zt [root@RHEL6A tmp]# ls -l mail lrwxrwxrwx. 1 root root 10 Dec 21 11:30 mail -> spool/mail 因为/var/mail是个链接文件,cp -r是递归的拷贝目标对象,cp -r /var/mail .只是拷贝了这个文件 [root@RHEL6A tmp]# ls -l /var/mail lrwxrwxrwx. 1 root root 10 Dec 8 13:44 /var/mail -> spool/mail cp -r /var/mail/ mail_tmp是表示递归的拷贝/var/mail目录下的对象到当前目录下,并重命名该目录为mail_tmp [root@RHEL6A tmp]# cp -r /var/mail/ mail_tmp [root@RHEL6A tmp]# ls data1.txt etc.tar.gz pulse-5iGMZJA28qP1 shac.sh data2.txt mail pulse-l74hRhWYTOSG test data3.txt mail_tmp shaa.sh user1_files.txt data4.txt osstarttest.txt shab.sh virtual-root.JOp5Zt [root@RHEL6A tmp]#
------解决方案--------------------