find -exec cp
How to move or copy files listed by 'find' command in unix?
find / -name core-* -exec cp {} /mnt/sda/OTHER/5.1.4bld1.0_log/aim_test/ \;
find . -name *.pdf | xargs -i cp {} ../docbook_pdf/
的写法的含义解释:
- find . -name *.pdf :递归式的找出当前文件夹及其子文件下的所有.pdf文件
- xargs -i xxx :其中xxx==cp {} ../docbook_pdf/,表示将输入的内容,用{}替换
- cp {} ../docbook_pdf/ :对于每一个find出来的文件,拷贝到对应的目标文件夹中。
Adding to Eric Jablow's answer, here is a possible solution (it worked for me - linux mint 14 /nadia)
You can refer to "How can I use xargs to copy files that have spaces and quotes in their names?" as well. |
|||||||||
|
Actually, you can process the
In the second example, the last part, the semi-colon is also considered as part of the
|
||||
|
|||
find . -mtime 1 -exec cp {} ~/test/ \;
– user529758 Jun 28 '13 at 15:58xargs
. That way, you can copy the files in batches. – Eric Jablow Jun 28 '13 at 16:01