
On Mon, Oct 07, 2019 at 07:46:50PM +1100, Andrew Greig wrote:
Rename 6H9A0001.CR2 6J9A0001.CR2 Rename 6H9A0002.CR2 6J9A0002.CR2 Rename 6H9A0003.CR2 6J9A0003.CR2 Rename 6H9A0004.CR2 6J9A0004.CR2 to Rename 6H9A0085.CR2 6J9A0085.CR2
Use the perl rename utility (aka prename or file-rename), **NOT** the rename aka rename.ul util in the util-linux package, which has completely different command-line options and capabilities. e.g. rename -n 's/6H/6J/' *.CR2 The '-n' makes it a dry-run, showing what it would change if you let it. To actually rename files, remove the '-n' or change it to '-v' for verbose output. BTW, perl rename is far more capable than trivial sed-like renames like this. any perl code that modifies $_ can be used as the rename script. If you're running a recent debian or similar, 'apt-get install rename' to make sure you have the perl rename instead of rename.ul (on older versions of debian, package was called libfile-rename-perl). It's packaged for other distros too. craig -- craig sanders <cas@taz.net.au>