Retrieve deleted files in linux: How to recover deleted files in Linux

Retrieving deleted files in Linux can be achieved by using the following code: Enter the following command in the terminal:

Retrieving deleted files in Linux can be achieved by using the following code:

1. First, enter the following command in the terminal:

sudo find / -name "*filename*"

2. Replace the above command with the file name you are looking for and press Enter.

3. The system will list all file paths containing the file name, and you can find the file you want based on the path.

4. If you want to restore the file to its original location, you can use the mv command to move the file to the correct location:

mv file path original path

For example: mv /home/user/tmp/test.txt /home/user/Documents/test.txt

Guess you like

Origin blog.csdn.net/weixin_44591885/article/details/132835690