Question: How to Recover Deleted Files in Linux?
Contents

Linux Operating System – Using lsof to Recover Deleted Files

  • Make a file: /> cd /tmp.
  • Run something to hold the file open: scum 97 tmp> less myfile &
  • “Accidentally” remove the file: tmp> rm myfile.
  • Use lsof to show the open file descriptor of the process:
  • Locate the open file descriptor in /proc:
  • The open file can now be copied back to its original location:

How can I recover permanently deleted files in Linux?

You’ll see the interface below:

  1. PhotoRec Data Recovery Tool for Linux.
  2. Select Partition to Proceed File Recovery.
  3. Linux File Recovery Options.
  4. Specify Recovery File Type.
  5. Save File Recovery Settings.
  6. Select Filesystem to Recover Deleted Files.
  7. Choose Filesystem to Analyze.
  8. Select Directory to Save Recovered Files.

Is there a way to recover deleted files in Linux?

You can use a command line tool like testdisk to recover such deleted files in Linux easily. You can find the text version of the article here:

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest