Skip to content

How to avoid 'argument list too long'

Lloyd Brookes edited this page Jul 17, 2018 · 1 revision

On macOS and Linux, wildcard glob expressions like *, ** etc are expanded before being passed into renamer. For example, if the follow command is run in a directory containing thousands of files you'll receive an error.

$ renamer --find txt --replace log *
-bash: /usr/local/bin/renamer: Argument list too long

Avoid this issue by enclosing the wildcard in quotes. This will prevent the shell performing filename expansion, allowing renamer to receive and expand the glob expression internally.

$ renamer --find txt --replace log '*'