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 ofrenameon your OS. Also see http://unix.stackexchange.com/a/238862/135943 – Wildcard May 23 '16 at 23:31Galaxy. You need to use[0-9]+to match any number of digits. And you shouldn't have spaces around-. – Barmar May 23 '16 at 23:43prename, notrename(renameis onlyprenameon Debian and derivatives). – Gilles 'SO- stop being evil' May 23 '16 at 23:47