Recover deleted files with foremost

Ever accidently deleted files with Shift + Del or directly at the command line, as I just did - arrgh! Then stop any further writings to the hard disk and try the good old command line programs foremost or photorec. Both are at its best already installed, otherwise that it is quickly done by

$ sudo apt-get install foremost testdisk

photorec is included in the testdisk utility and a more guided solution, although still running in the bash. While foremost works straight foward at the command line:

$ man foremost
$ foremost -t pdf -i /dev/sda1 -T
$ cat output/audit.txt
$ ls -l output/pdf/

That is it.

NO COMMENT BOX
Right, not here. But it doesn’t mean I’m not interested in your feedback. I just prefer to use more busy services ;-) where a wider discussion could incur. So tweet me @netzfisch or if you find an error, fork my blog, correct the post and send me a pull request via GitHub. Thanks for your efforts.
CHEAT SHEETS
ELSEWHERE