日期:2014-05-16  浏览次数:20644 次

Linux/Unix 中如何在复制一个目录时排除其中的某个文件
[oracle@prod ~]$ mkdir test1
[oracle@prod ~]$ mkdir test2
[oracle@prod ~]$ cd test1
[oracle@prod test1]$ touch 1 2 3 4 maomi


cp `ls | grep -v maomi | xargs` ../test2


[oracle@prod test1]$ cd ../test2
[oracle@prod test2]$ ls -lt
total 0
-rw-r--r-- 1 oracle oinstall 0 Mar 10 17:20 1
-rw-r--r-- 1 oracle oinstall 0 Mar 10 17:20 2
-rw-r--r-- 1 oracle oinstall 0 Mar 10 17:20 3

-rw-r--r-- 1 oracle oinstall 0 Mar 10 17:20 4


转载请注明出处及原文链接:


http://blog.csdn.net/xiangsir/article/details/8715042