mass renaming in order
Hey all,
I have a folder with 3000 image files that need to be made into a movie. I want to get rid of 90% off them, since they are not needed. Right now I have: mov0001.png mov0002.png mov0003.png etc. I can remove 90% of them with the command rm ./mov???[123456789].png which will keep only files ending in 0. However, the movie program needs files names in order to work. How can I rename all the remaining files back to mov0001.png mov0002.png mov0003.png etc in order? Is there a (relatively) simple command I can use? Thanks :) |
Well, there's the
rename command, with somewhat unusual syntax, but it can be useful in your case. |
Could you give me some more details? I am new to linux. I have seen a few references to the rename command, but am as yet unsure what format strong I would need to recognize the files I am looking for.
I would need to rename mov0010 mov0020 mov0030 mov0040 etc to mov0001 mov0002 mov0003 mov0004 etc |
If you list them, they should be already sorted by name, so that you can do a simple loop:
Code:
count=0 |
Cool thanks :)
time to learn shell scripting I think |
Hi,
Welcome to LQ. Code:
#!/bin/bash Cheers, Tink P.S.: Heh ... toooooo slow. |
All times are GMT -5. The time now is 11:09 PM. |