N
N
nihi1ist2021-03-13 04:39:17
linux
nihi1ist, 2021-03-13 04:39:17

How to escape characters in rename?

I want to remove part of the filename -2.7.27-3324using the rename utility. You need to remove part of the filename in all directories starting from the source directory. I'm trying to do this: I get an error:
rename -f -n 'y/-8.3.18-1334//' *.png

Invalid range "8-1" in transliteration operator at (user-supplied code).

Tried escaping with \and '. Does not help. Tell me how to correctly specify the options for rename?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AUser0, 2021-03-13
@nihi1ist

find. -name *.png -type f -exec rename -f 's/-2\.7\.27-3324//' '{}' \;

S
stoptalking, 2018-01-17
@LemonRX

bottom sheet or something

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question