In one directory I have many files which look like this:
Galaxy100-[0025-CL3.single.bed].bed
and I would like to change it to:
0025-CL3.single.bed
I tried this rename 's/Galaxy[0-9] - \[//' *
, but it did not change anything.
How is possible to rename these files?
man rename
; you are using the wrong syntax for the version ofrename
on your OS. Also see unix.stackexchange.com/a/238862/135943Galaxy
. You need to use[0-9]+
to match any number of digits. And you shouldn't have spaces around-
.prename
, notrename
(rename
is onlyprename
on Debian and derivatives).