[Mageia-discuss] Debian-style «rename» utility?

Johnny A. Solbu cooker at solbu.net
Tue Jan 1 21:58:12 CET 2013


Sometimes I need to mass rename filenames, to replace norwegian special caracters, to make things work across samba.
On Debian th rename utility user «sed» style replacements, which means one command can replace all instances of a character or string recursively in all subfolders. But on Mandriva and Mageia, I have to run the exact same command multiple times in the same folder to do the same thing. And I can't do it recursively.

One example. Say I want to recursively replace all spaces ' ' with an underscore '_' on all files in every subfolder under «folder2»

On Debian: 
	replace 's/\ /_/g' folder2/

On Mageia:
	cd folder2
	replace ' ' '_' *
	replace ' ' '_' *
	replace ' ' '_' *
	replace ' ' '_' *

	cd subfolder1
	replace ' ' '_' *
	<repeating>
	<repeating>
	......
and so on.

Is there a command line utility on Mageia that can do this te way Debian does this, without resorting to creating a shellscript each time I need to replace something? (I'm no good at scripting, so I've had to do this manually for some 11 years.)

-- 
Johnny A. Solbu
PGP key ID: 0xFA687324
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: </pipermail/mageia-discuss/attachments/20130101/352086aa/attachment.asc>


More information about the Mageia-discuss mailing list