Linux 利用管道复制cp多个文件到指定目录

一、ls | tail -11| xargs -i cp -r {} /root/web/templates/

      拷贝最后11个文件到根目录的/root/web/templates/

二、ls | grep test | xargs -i cp -r {} /root/web/templates/

     筛选当前目录下文件名包含test的文件,拷贝到/root/web/templates/

猜你喜欢

转载自blog.csdn.net/carrey_0612/article/details/86674688