Re: remove double quote character from file names
Date: Sat, 11 Feb 2023 15:40:11 UTC
> On Sat, Feb 11, 2023, 15:59 Per olof Ljungmark <peo@nethead.se <mailto:peo@nethead.se>> wrote: > > Hi all, > > A little help on the way, I need to find and remove the double quote (") > character from all files in a directory structure containing hundreds of > thousands of files. > > I am sure plenty of you have done this before... I've gotten as far as > > find . -type f -name '*"*' -exec rename 's|"|in|g' {} \; > find: rename: No such file or directory > > The find part works but not renaming so I'm missing something there. > <Shameless self-promotion follows ;) > Some years ago I set about to write the mother of all renaming utilities exactly because I didn't want to have to go through endless contortions of sed, gerp, awk, ag, and so forth to do simple renaming tasks like yours. The result is 'tren' which does what you want rather trivially: find ./ -name '*"*' -exec tren -r'"'=X {} \; tren can do way more than this (and probably has plenty of undiscovered edge cases and/or bugs), but I use it regularly and it has vastly simplified my renaming tasks. Code and extensive docs here: https://gitbucket.tundraware.com/tundra/tren HTH...