How to delete files when you encounter: -bash: /bin/rm: Argument list too long
If you have tried to empty any large folders, such as mailbox directories or temporary folders on a linux server you will probably encountered the following error:
-bash: /bin/rm: Argument list too long
An easy way around this is to use the following command (this will remove all files in the folder you run this command):
find . | xargs rm
If you want to delete files with a specific string in them, you can do with the following:
find . -name ‘*string*’ | xargs rm
Hosting Options & Info | VPS | Web Solutions & Services |
---|---|---|
-
Geoffrey McRae
-
Geoffrey McRae