Ubuntu – Rename command special characters in filename

filenamerename

I would like to remove [] in multiple file names.
I get an error when doing it with the rename command.

Is there another way to do this?

Best Answer

[] are special characters in Perl Regex syntax which is used by rename command. Use \ in front them. Example:

rename "s/\[|\]/_/g" *

ie:

s replace
[
| or
]
  with
_
* for all files here