Change spaces or dots in file name to dashes

Serg B. sergicles at gmail.com
Sun May 13 14:49:43 UTC 2007


WARNING: Not tested - so test it first.

>From top level directory do:
find . -exec rename -v 's/[^\w\d\-]/_/g' {} \;

On 13/05/07, Dave M <DaveM at mich.com> wrote:
> At 12:41 PM 5/11/2007 , Toby wrote:
> >    rename -v 's/[^\w\d\-]/_/g' *
> >
> >to replace all non-alphanumeric-or-dash characters with underscores in all
> >files
> >in the current folder.
>
> Thank you for the very useful tip. Is there an easy way to make it traverse
> a directory tree and fix the names of all of the files in the various
> sub-directories?
>
> -------------------------------
> Dave M
> Davem (at) Mich (dot) Com
> Ann Arbor, Mich. USA
>
> Protect your digital rights: http://www.eff.org
> "The 'Analog Holes' they want to stop up are our eyes, ears and mouths."
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>


-- 
Serg




More information about the ubuntu-users mailing list