
15 Nov
2019
15 Nov
'19
2:22 a.m.
https://www.maketecheasier.com/rename-files-in-linux/ On Fri, 15 Nov 2019 at 12:51, Piers via luv-main <luv-main@luv.asn.au> wrote:
Hi there,
I have a bunch of files that I want to rename:
123.someword.doc > 123.doc
456.someword.pdf > 456.pdf
The "someword" is consistent in all the files and they need to be renamed recursively.
Something like this but with a different regex:
# This is for a completely different file name structure
find . -name '123*.txt' -type f -exec bash -c 'mv "$1" "${1/\/123_//}"' -- {} \;
...sorry regex is a shortfall of mine.
Thanks in advance.
Cheers
Piers
_______________________________________________ luv-main mailing list luv-main@luv.asn.au https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main
-- Dr Paul van den Bergen