mac下find: -exec: no terminating ";" or "+"的解决方法
2016-05-02 11:46
483 查看
如果想从一个含有很多文件的目录中拷贝指定文件去另一个目录,会报以下错误:
$ ls *_text.jpg argument list too long: ls $ cp *_text.jpg ~/Desktop/word argument list too long: cp
这报的错误其实是提示你ls或者cp的文件过多,而不是命令的参数过长。解决方法如下,可以配合find && exec完成。
$ find . -name "*_text.jpg" -exec cp {} ~/Desktop/word (查找当前目录下文件名包含_text.jpg的所有文件,拷贝到~/Desktop/word目录中,其中{}是find命令查找出来的所有结果) find: -exec: no terminating ";" or "+"
出现
find: -exec: no terminating ";" or "+"的问题,解决方法很简单,在命令尾部加一个” \;”。也就是:
$ find . -name "*_text.jpg" -exec cp {} ~/Desktop/word \;
不仅如此,还可以取反转换成tif格式试试~
$ find . -name "*_text.jpg" -exec convert -negate {} ~/Desktop/word/{}.tif \;
当然,也可以用脚本实现。
相关文章推荐
- VMware下 Ubuntu 看不到共享文件夹之解决办法
- 快稳炫:电商峰值系统架构三字诀
- 快稳炫:电商峰值系统架构三字诀
- tornado用户指引(五)------- 一个并发的web爬虫
- HDU-ACM2075
- 45-Letter Combinations of a Phone Number
- Filezilla client站点出现中文乱码的解决办法
- 快稳炫:电商峰值系统架构三字诀
- Qt css样式大全(整理版)
- iptables 防火墙之主机防火墙
- 并查集总结
- HDU-ACM2074
- 聊一聊如何实现Xilinx Microblaze Bootloader
- fcitx候选词竖排
- java循环
- jQuery-Ajax
- HDU-ACM2070
- jAVA接口回调
- android studio导入项目出错:Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with multiple errors, see logs
- allocator class