If you are comfortable at all in vim and are not opposed to using something besides mv
, you might consider vimv. I like it for batch renaming because it lets me see what I'm doing before I do it. (And because I like vim.)
EDIT 2022-07-08: Upon re-reading the docs, it appears you don't have to use vim. It's possible to tell vimv to use a different editor.
EDIT 2022-07-09: It was pointed out to me that my answer doesn't provide enough detail to be considered an answer to the question.
The vimv approach to renaming (or deleting) files is to open the file listing in your preferred text editor. There, you edit each filename to whatever you wish it to be, however you do that in your editor. (To delete the file, replace it with a blank line.) Upon exiting the editor, the files are moved (or removed) according to your edits.
Country_City_S1.txt
or 2 files with namesCountry, City S1.txt
+Country City S1.txt
. Mind there is another issue: he said commas AND spaces. SoCountry, City S1.txt
should technically be replaced toCountry__City_S1.txt
(3x _) and either the title is wrong or the body ;-) Seems nitpicking but ...mv
is not so forgiving when it comes to duplicates so better safe than sorry :D