'Argument list too long' workaround on Linux
|
If ,for example, you try to delete all the files in a directory and their number is high, chances are you'll receive an 'argument list too long' error. Here is a quick workaround. Supposing you need to delete all the files beginning with 'testing', this will be the command:
find . -name 'testing*' -print0 | xargs -0 rm
The '-print0' action of 'find' allows to correctly parse file names containing white spaces, and idem for the '-0' of 'xargs'.
|