msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

28 Oct 2007 Rename files in folder

Posted by

Oneliner to rename files/directories. It converts ” ” into “_” and the characters to lower-case.

$> perl -e 'while(< *>) { $old=$_; s/ +/_/g; rename($old,lc($_)); }'

To limit it to a single filetype use it this way and replace ”.doc” with whatever you like.

$> perl -e 'while(< *.doc>) { $old=$_; s/ +/_/g; rename($old,lc($_)); }'

Tags:

Comments are closed.