1. find ./ -iname “*.bid” -exec cp  {} bid/ \;

将目录下所有匹配的文件copy到一个目录下,不包含路径。

或:find ./ -iname “*.bid” -exec cp  -t  bid/ {} +

2.find ./ -iname “*.bid” -exec tar cvzf bids.tar.gz  {} +
将目录下所有匹配的文件打包,包含对应的路径。

http://forum.ubuntu.org.cn/viewtopic.php?f=21&t=108619

两个find命令
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.