Monday, 8 April 2013

Recover accidentally deleted file as long as some process still has it open, on Linux


  1. lsof | grep myfile
    1. the second column is the process id
    2. the number in the fourth column is the file descriptor
  2. cp /proc/<process id>/fd/<file descriptor> myfile.saved

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Interview questions: 2020-12

Terraform provider vs provisioner Load balancing Network Load Balancer vs Application Load Balancer  Networking Layer 1 vs Layer 4 haproxy u...