[OOZY] Renaming more than 200 pics

carson.wilcox at verizon.net carson.wilcox at verizon.net
Sun May 7 17:40:00 UTC 2006


This is a python script that will replace a spaces in the file names in the current dir with "-".

#!/usr/bin/python
#this script will remove
#from file names
import os
files=os.listdir(".")
for i in files:
    newname=i.replace(" ","-")
    os.rename(i,newname)

Carson Wilcox

-----Original Message-----

From:  "OOzy Pal" <oozypal at gmail.com>
Subj:  [OOZY] Renaming more than 200 pics
Date:  Sun May 7, 2006 1:31 pm
Size:  354 bytes
To:  "Ubuntu Help and User Discussions" <ubuntu-users at lists.ubuntu.com>

As you all know that Linux puts a backslash \ before spaces in files
names. I  would like to rename all my pictures. Basically I would like
to convert each space in a file name to a dash. How can I do this from
the command line.

--
OOzy

-- 
ubuntu-users mailing list
ubuntu-users at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users






More information about the ubuntu-users mailing list