I have a lot of files with [] characters in them and I wanted to remove them with the following command:
rename 's/[xy]/xy/' *
You can run this command this way
rename 's/\[xy\]/xy/' *
You need to escape special symbols by backslash.
Ubuntu of rename
is written in Perl.
It requires regular expression of Perl.
"[
" escaped with "\
".
# remove one pair
rename -n 's/\[(.*)\]/$1/' *
# remove all [ and ]
rename -n 's/\[|\]//g' *
rename.ul