find 命令 移动 指定文件到 其他目录

把当前目录下大于10G 的文件 全部移动到 /test 目录下

之前想的有点简单 使用 find  . -size +10G -type f | xargs mv /test/ 以为可以成功 实际情况语法是有问题     

晚上看了一些 资料 正确的方式如下  

find  . -size +10G -type f | xargs -I '{}' mv {} /test/     

find . -size +10G -type f | -exec mv {} /test \;

猜你喜欢

转载自blog.csdn.net/weixin_42123737/article/details/82838036