美文网首页
linux: Argument list too long

linux: Argument list too long

作者: 遇酒无缘 | 来源:发表于2018-05-30 11:54 被阅读0次

问题

在linux环境中,当用mv、cp、rm、ls操作大量文件时,会出现Argument list too long 错误

解决办法

用find命令,注意:结束符不能省“ \;”

find sourcePath/ -name "*.txt"  -exec mv {} targetPath/  \;
#or
find sourcePath/ -type f  -exec mv {} targetPath/  \;

相关文章

网友评论

      本文标题:linux: Argument list too long

      本文链接:https://www.haomeiwen.com/subject/ivytsftx.html