查找和复制文件 [英] Find and copy files

查看:155
本文介绍了查找和复制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么不将文件复制到目标文件夹?

Why does the following does not copy the files to the destination folder?

# find /home/shantanu/processed/ -name '*2011*.xml' -exec cp /home/shantanu/tosend {} \;

cp: omitting directory `/home/shantanu/tosend'
cp: omitting directory `/home/shantanu/tosend'
cp: omitting directory `/home/shantanu/tosend'


推荐答案

如果您的目的是复制找到的文件到/ home / shantanu / tosend你有cp的参数的顺序颠倒:

If your intent is to copy the found files into /home/shantanu/tosend you have the order of the arguments to cp reversed:

find /home/shantanu/processed/ -name '*2011*.xml' -exec cp {} /home/shantanu/tosend  \;

这篇关于查找和复制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆