Linux – the best way to undelete some photos on Linux? Is there any way to use foremost to only recover files that only contain some text

forensicsgreplinuxphotos

I accidentaly deleted some digital photos I had recently taken, and I wanted to undelete them. I found out about Foremost, and it allows me to recover jpg files, but will fo that with all of the images I ever deleted.

I know all the files I want will contain the string "COOLPIX L20" in some part of the file. I can grep the hard drive and will find something, but I don't know how to "separate" that into image files.

In short, is there any way for foremost to only recover files with some string, or some better ay to do it?

Best Answer

See PhotoRec.

PhotoRec is file data recovery software designed to recover lost files including video, documents and archives from hard disks, CD-ROMs, and lost pictures (thus the Photo Recovery name) from digital camera memory. PhotoRec ignores the file system and goes after the underlying data, so it will still work even if your media's file system has been severely damaged or reformatted.

Related Question