Re: Change spaces or dots in file name to dashes



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@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



Relevant Pages

  • Re: Change spaces or dots in file name to dashes
    ... WARNING: Not tested - so test it first. ... to replace all non-alphanumeric-or-dash characters with underscores in all ... in the current folder. ...
    (Ubuntu)
  • Re: Change spaces or dots in file name to dashes
    ... to replace all non-alphanumeric-or-dash characters with underscores in all files ... in the current folder. ... Sometimes filenames can contain tabs or control ...
    (Ubuntu)
  • Re: Add AVI Files to a Web Site
    ... Assuming that you create a folder called "downloads" on your host in the ... directory at what will be the same level as your web files, and upload your ... and no other special characters other than underscores or dashes. ...
    (microsoft.public.publisher.webdesign)
  • Re: link/upload ques - how do you create absolute links?
    ... same directory level as the index.htm file and the index_files folder. ... I personally also avoid underscores ... go to my server, and that isn't even the lastest version of them. ... Does the order of upload matter? ...
    (microsoft.public.publisher.webdesign)
  • using a SELECT with the RESERVED Underscore character
    ... i am trying to select files in a folder that uses underscores as part of the ... filename, obviously it isn't working, see below: ... what syntax would i use to get around this Select problem? ...
    (microsoft.public.scripting.vbscript)