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

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

问题描述

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

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


解决方案

添加到埃里克Jablow的答案,这里是一个可能的解决方案(它对我来说 - - linux mint 14 / nadia)

$ find $ / $ / to / search / -type f -nameglob-to-find-files| xargs cp -t / target / path /

你可以参考我可以怎样使用xargs来复制空格和引号的文件?

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 {} +

解决方案

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/

You can refer to "How can I use xargs to copy files that have spaces and quotes in their names?" as well.

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

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