Try this ( bash --version > = 4 required):
shopt -s globstar rename -n 's/special/regular/' **
Uncheck the -n switch when your tests are ok.
There are other tools with the same name that may or may not do this, so be careful.
If you run the following command ( GNU )
$ file "$(readlink -f "$(type -p rename)")"
and you have a result like
.../rename: Perl script, ASCII text executable
and not containing:
ELF
then this seems like the right tool =)
If not, to make it standard (usually already) in Debian and derived like Ubuntu :
$ sudo update-alternatives --set rename /path/to/rename
(replace /path/to/rename with the path of your perl rename command.
If you do not have this command, find the package manager to install it or run manually
Last but not least, this tool was originally written by Larry Wall, the father of Perl.
Gilles Quenot Feb 21 '13 at 21:34 2013-02-21 21:34
source share