3 ms·
I've used a rename(1) utility^ that is apparently part of some Perl distribution. It's always been available on my Ubuntu systems and I haven't gone out of my w
by scintill76 10y ago
I've used a rename(1) utility^ that is apparently part of some Perl distribution. It's always been available on my Ubuntu systems and I haven't gone out of my way to install it. bar ⇒ baz would be something like: rename 's/\.bar$/.baz/' *.bar
You can dry-run first with `-n` flag if you're worried you didn't do it right, which is admittedly too possible. A bit more verbose, but a bit more powerful too.
^ http://manpages.ubuntu.com/manpages/trusty/man1/prename.1.html http://manpages.ubuntu.com/manpages/trusty/man1/prename.1.ht...
- cheiVia0 10y agoI don't use Ubuntu, but it's weird that it seems to replace the rename command from util-linux, and has a completely different syntax: http://manpages.ubuntu.com/manpages/trusty/man1/rename.ul.1.html http://manpages.ubuntu.com/manpages/trusty/man1/rename.ul.1....
- scintill76 10y agoYeah, I found that as I was writing the comment. I guess the full names on Ubuntu are prename (P for Perl?) and rename.ul (UL for util-linux?) On my system, rename is symlinked to prename through the 'update-alternatives' system, but apparently rename.ul is not registered as a choice there. Strange.