Lsof implementation of Linux to recover deleted files

Source: Internet
Author: User

    1. Server/root directory has a.list, aa.list 2 files aa.list for a.list copy

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/74/CA/wKiom1Yo3JzQ39XfAACiI1CcHpk776.jpg "title=" QQ picture 20151022205228.png "alt=" Wkiom1yo3jzq39xfaacii1cchpk776.jpg "/>


2. One terminal with more Occupy A.list, at the other end of the a.list deleted

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/74/C6/wKioL1Yo3ieguaJNAAChReiiVHo082.jpg "title=" QQ picture 20151022210105.png "alt=" Wkiol1yo3ieguajnaachreiivho082.jpg "/>


3. Use Lsof to view the next a.list

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/74/C6/wKioL1Yo3naDFsTbAACMZ605Dz8551.jpg "title=" QQ picture 20151022210217.png "alt=" Wkiol1yo3nadfstbaacmz605dz8551.jpg "/>

The first column is the process name the second column is the PID fourth column is the file descriptor


4. Process 2039 is opening the file descriptor is 4, with LS view under: Ls-l/PROC/2039/FD/4

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/74/CA/wKiom1Yo34exYiYkAACZ-qTtN2g755.jpg "title=" QQ picture 20151022210749.png "alt=" Wkiom1yo34exyiykaacz-qttn2g755.jpg "/>


5. recover files with cp command

CP/PROC/2039/FD/4/root/b.list


6. Verify that 2 files are the same

Diff Aa.list B.list

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/74/CB/wKiom1Yo8dOyGNUkAABR47GqUww440.jpg "title=" QQ picture 20151022222415.png "alt=" Wkiom1yo8doygnukaabr47gquww440.jpg "/>

MD5 Verification

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/74/CB/wKiom1Yo8lWzbtwDAACpCkWzoWs219.jpg "title=" QQ picture 20151022222655.png "alt=" Wkiom1yo8lwzbtwdaacpckwzows219.jpg "/>


This article is from the "left-handed" blog, make sure to keep this source http://mofeihu.blog.51cto.com/1825994/1705406

Lsof implementation of Linux to recover deleted files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.