Skip to content

delete file: Argument list too long in Linux

Argument list too long in Linux

use find

find . -name filename | xargs rm -f

但文件数量过多,find命令也会出现问题:

-bash: /bin/find: Argument list too long

use xargs

ls | xargs -n 50 rm -rf

xargs控制50个为一组,一次删除一组即可