3 ms·
I use rename[1] to clean up problematic filenames. Sadly I have to rename it to `rnm` because there is a namespace conflict with rename.pl in util-linux. On OSX
by dfc 14y ago
I use rename[1] to clean up problematic filenames. Sadly I have to rename it to `rnm` because there is a namespace conflict with rename.pl in util-linux. On OSX it is as easy as `brew install rename.` I do not know why it has never made it into the debian.
Taking care of a directory full of madness is as easy as `rename -z`:
-z, --sanitize
Replaces consecutive blanks, shell meta characters, and control characters
in filenames with underscores.
[1] http://plasmasturm.org/code/rename http://plasmasturm.org/code/rename
- telemachos 14y agoSomewhat random, but I'm the person who "packaged" Aristotle Pagaltzis's outstanding rename for Homebrew. I'm very glad to hear people other than me are using it too.
- dfc 14y agoMany thanks!!! I cant tell you how often I use that command. Or how many times I had scoured `apt-cache search` results looking for this functionality.
- chimeracoder 14y ago> Sadly I have to rename it to `rnm` You just like to live on the edge, don't you? $ rm foo.{bar,bar.bak} vs. $ rnm foo.{bar,bar.bak}
- dfc 14y agoIn light of the fact that I never run rnm without the `-z` option its not that scary of a ride. $ rm -z * rm: invalid option -- 'z' Try `rm --help' for more information.