Script to change file names?

Marcos Soares

New Member
Joined
Dec 25, 2015
Messages
5
Reaction score
0
Country
Portugal
I'm looking for a script that will change the name of files to something like "CAM100001".

Does anyone knows how to do it?

Thanks!
 

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
107
Country
China
If you want to rename on pc, there are tons of software you can use, e.g. I like to use exiftool to rename picture & movie;

If you want to rename on camera, you should write a bash shell script... but a little bit difficult to let it work.
 

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
107
Country
China
try this
Code:
#!/bin/sh

count=1
for img in *.jpg; do
  new="CAM1"`printf "%.5d" ${count}`".jpg"
  mv ${img} ${new}
  let count++
done
 
Top