Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
The best way to "recover deleted files"
is really to avoid permanently delete files.
It is suggested that you avoid using the rm
command
(unless you are 100% sure what you are doing)
.
Insted,
you can use a file manager provided by a Linux desktop to delete files.
This way,
deleted files are moved to the Trash directory,
which can be recovered easily.
If you must use a command-line tool,
it is suggested that you use one of the following safer alternatives to rm
.
Recover Files Using extundelete
sudo mount -o remount,ro /dev/sdb1
sudo extundelete --restore-all /dev/sdb1