delete file: Argument list too long in Linux
Argument list too long in Linux
find . -name filename | xargs rm -f
too many files may also cause the argument list too long problem.
-bash: /bin/find: Argument list too long
ls | xargs -n 50 rm -rf
xargs could control the batch size of an output. In this case, 50 elements in a batch/group, and pass to rm to process progressively.
- License under
CC BY-NC 4.0
- Copyright issue feedback
me#imzye.me, replace # with @
- Not all the commands and scripts are tested in production environment, use at your own risk
- No privacy information is collected here