3 ms·
rename -n 's/(.*)/new$1$2/' * There's a chance this won't work on your system. There are two incompatible versions of rename in the wild: 1) Perl one: https:
by jwilk 9y ago
rename -n 's/(.*)/new$1$2/' *
There's a chance this won't work on your system.
There are two incompatible versions of rename in the wild:
1) Perl one: https://metacpan.org/pod/distribution/File-Rename/rename.PL https://metacpan.org/pod/distribution/File-Rename/rename.PL
2) from util linux: http://man7.org/linux/man-pages/man1/rename.1.html http://man7.org/linux/man-pages/man1/rename.1.html
Debian (and dertivaties) ship the former; other Linux distros likely the latter.
- falsedan 9y agoI think this is not specific to the shell you are using, so it happens in bash, fish, ksh, zsh, and so on.
- gbacon 9y agoIt’s misleading because rename is a command that accepts regex arguments. The shell isn’t doing anything more sophisticated with the quoted argument than passing it to rename as a positional parameter. The shell of course does expand unquoted globs.