Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Last night, I used exiftool to batch rename a collection of .mov files. Some of the files were renamed as required, but many of them were left without an extension.

I think the required EXIF tag that I used in the exiftool command was missing from some the files, resulting in ~140 .mov files renamed in a timestamp format without an extension.

Rather than manually appending .mov to each file, I searched Google for a script to automate the process. I adapted an example and executed it (*+0100 refers to common string at the end of all the target files):

$ for i in *+0100; do mv "$i" "`basename $i *+0100`.mov"; done

For some reason, ~140 files disappeared and I was left with a single file with a .mov extension. Not quite what I was expecting!

I searched the partition with photorec, but I haven't been able to recover the files. Is there any other way I may be able to recover them? These particular family videos were some of the few that I had not yet backed up.

share|improve this question
up vote 1 down vote accepted

See the DataRevovery.

Next time, when you do such loops always add echo as a first command. After you see what you are about to do, remove the echo, and rerun. It's a common mistake - sorry.

share|improve this answer
Thanks for your advice, Michał. I will be more careful in future. – unpossible Oct 19 '11 at 20:50

When I try that command I just get an error with basename, I think is was meant to be:

for i in *+0100; do mv "$i" "`basename $i`.mov"; done

I don't think they can be recovered, but you can try extundelete.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.