击:查找和复制 [英] Bash: find and copy

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

问题描述

任何人有在bash比找到并复制文件的另一种方法:

Anybody has an alternate way of finding and copying files in bash than:


找 。 -ctime -15 | AWK'{打印CP$ 1../otherfolder/}'| SH

我喜欢这种方式,因为它的灵活,为我建设我的命令(可以由任何命令)后执行它。

I like this way because it's flexible, as I'm building my command (can by any command) and executing it after.

是精简指令到文件列表中还有别的办法吗?

Are there other ways of streamlining commands to a list of files?

感谢

推荐答案

我会建议使用找到的 -exec 选项:

找到。 -ctime 15 -exec CP {} ../otherfolder \\;

与往常一样,请咨询以获得最佳效果的联机帮助页。

As always, consult the manpage for best results.

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

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