Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
How do I recover lost/inaccessible data from my storage device?

I accidentally deleted all files from one of my hard drives. I have recovered most of the files, but there is around 1 TB of data. I mainly want to recover my pictures, but they are mixed with thousands of other random/damaged files/photos.

Is there software which can scan all "good" photos and make a new folder containing them? Or a script that I can run to do this?

I am using Windows 7.

share|improve this question

marked as duplicate by Tom Wijsman, Canadian Luke, HackToHell, ChrisF, Renan Jan 13 '13 at 14:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Open to any OS? If so, a script can be built pretty easily using find . -name *.jpg then piped through imagemagick's "identify" command. If you're open to Linux/Unix tools I'll find my old script to filter out bad images. – nerdwaller Jan 13 '13 at 0:18

1 Answer 1

Found my old script that incorporated a function like what you're looking for. This is using Bash and Imagemagick (on Linux):

#!/bin/env bash
 for img in `find /loc/of/saved/items -type f -iname "*.jpg"`; do
    if identify "${img}" &> /dev/null; then
        mv ${img} /identified/files
share|improve this answer
Pet peave replace #!/bin/bash with #!/bin/env bash. Does the same if there is a bash in /usr/bin, but also works if it is elsewhere (e.g. when the bash in /usr/local/bin/ and the default is sh, dash or just about anything) – Hennes Jan 13 '13 at 0:35
Learn something new everyday, thanks! I was wondering why I had seen that with python. – nerdwaller Jan 13 '13 at 0:41
If replaces the maintenance of scripts with dozens of interpreters with the maintenance of a single program. Quite nice if you need to take care of more than a few systems with different operating systems. (and thus the interpreters in various places). – Hennes Jan 13 '13 at 0:50
Thanks @Hennes! – nerdwaller Jan 13 '13 at 0:54

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