I have A LOT of files named "bar_foo.txt" in a directory, and I'd like to rename them to "foo_bar.txt" instead.
vim the regex to to this would be something like
's/\(bar\)_\(foo\)/\2_\1/g', backreferencing the search in the replacement.
Is there a way to do this with
rename? I've seen some hacks piping
bash, but that's obviously not an amazing way to do it.
Are there another tools that does this?
Is there a name for the "sed and vim flavour" of regex?