An error came quickly, even on a system as simple as Ubuntu. Whether you have lost a photo, a document or even an archive, there is an effective solution for recover deleted file on ubuntu : Foremost. In this tutorial, we will see how to install and use this handy little software.
To avoid any unfortunate loss of your important files, we recommend that you create regular backups. If you don't know how to do it, don't hesitate to read our tutorial “How to create a restore point on Ubuntu?”.
Recover Deleted File on Ubuntu with Foremost
- Open a terminal from the application launcher.
- Enter the command sudo apt install foremost to install the Foremost utility.
- Enter your password then validate with the key Starter.
- To determine which files can be recovered, enter the command sudo foremost -w -i / dev / sda1 -o / Recup. The utility will scan your hard drive for all deleted files and send its report to a file placed in the Recup folder.
- Here is an example of the file generated by the previous command. There is a lot to recover!
- Here we will try to find all the images in png format deleted by mistake from the PC. To do this, simply enter the command sudo foremost -t png -i /dev/sda1 -o /RecupImages then validate with Starter.
- After a little while, all the recovered images will be visible in the folder RecupImages created at the root of the disk.
- Foremost does more than just find images. To learn more about the possibilities of this utility, just use the command man foremost in a terminal.
In case of accidental deletion, do not hesitate to use Foremost as soon as possible. The longer you delay, the more likely you are to permanently lose your files!
To download :
Find other tutorials on Ubuntu:
- How to Format a USB Drive or Hard Drive on Ubuntu?
- Essential Ubuntu Keyboard Shortcuts
- The essential command lines to know on Ubuntu
- How to change a QWERTY keyboard to AZERTY on Ubuntu?
- How to create a restore point on Ubuntu?