如何在 unix 中移动或复制“find"命令列出的文件? [英] How to move or copy files listed by 'find' command in unix?

查看:12
本文介绍了如何在 unix 中移动或复制“find"命令列出的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用以下命令看到的某些文件的列表,但是如何将列出的这些文件复制到另一个文件夹中,比如 ~/test?

I have a list of certain files that I see using the command below, but how can I copy those files listed into another folder, say ~/test?

find . -mtime 1 -exec du -hc {} +

推荐答案

添加到 Eric Jablow 的答案,这是一个可能的解决方案(它对我有用 - linux mint 14/nadia)

Adding to Eric Jablow's answer, here is a possible solution (it worked for me - linux mint 14 /nadia)

find /path/to/search/ -type f -name "glob-to-find-files" | xargs cp -t /target/path/

您可以参考如何使用 xargs 复制名称中包含空格和引号的文件?" 以及.

这篇关于如何在 unix 中移动或复制“find"命令列出的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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