LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   auto rename contents of a DIR (https://www.linuxquestions.org/questions/linux-general-1/auto-rename-contents-of-a-dir-34676/)

bkeating 11-05-2002 06:25 PM

auto rename contents of a DIR
 
k, so here I am with a diretory full of PNG's named to fit numerical order (e.g.: 1.png, 2.png, etc.)

I /know/ theirs a way to auto rename all the files to like lets say:

2002-11-05_-_image_001.png
2002-11-05_-_image_002.png

Any idea on which tool can do this? Is their something available on a default system install without having to download some script?

I will continue my search...

acid_kewpie 11-05-2002 06:34 PM

download?? why not just write it??

for i in *.png
do
mv $i `date +%D`_-_image_$i
done

nothing too taxing is it? the resultant filename there isn't exactly to what you give as an example, but i think that should be left as an exercise to the reader, don't you? ;)


All times are GMT -5. The time now is 11:32 PM.