When a person is operating under Linux, they may encounter that the file they are doing is accidentally deleted by others, and there is no corresponding backup before, then it may need to rewrite the file. The following describes a more practical way to recover accidentally deleted files.
An operation method
1.1 User A is viewing the strace.log file;
1.2 User B deleted this file at this time
1.3 C also wants to see this file and finds that the file is no longer;
1.4 This time uses losf to find the process of the deleted file;
1.5 View the file descriptor associated with the process;
< H2>1.6 copy and restore files;
two principles
Save the directory and name of the process under the /proc partition of the Linux system, including fd (file descriptor) and subdirectories under it (process Open the link to the file), then if you delete a file, there is also a reference to the inode: /proc/process number/fd/file descriptor. As long as we know the process pid and file descriptor fd of the currently open file, we can use the lsof tool to list the files opened by the process.
Three considerations
This method can only be used when the file is used or called. It is suitable for the case where the machine is not shut down and the process is not finished. If the machine has been shut down, you can try to use the rescue mode. The anti-delete tool attempts to recover, as long as the data is not overwritten, there is still a greater chance of retrieving the data.
There are some scenario where system admin wants only few users should be allowed to transfer files
For Linux systems, whether it is a central processor, memory, disk drive, keyboard
vmstat is a tool for viewing virtual memory usage. General format: vmstat [-V] [-n] [delay [count]]C
Execlp looks for a file from the PATH environment variable and executes the definition: int execlp(
After linux2.6.38, the kernel version calls open
Awk View the number of ip connections (common application one)
2000 and Linux dual system installation
Solaris restart syslog configure separate authentication log
Explain in detail the practical security of home Linux
Skills Delivery: Handling Linux Kernel Security Details
The reason why the driver of the single-chip microcomputer should be set to low level is
Linux system Chinese display garbled how to do?
Linux coding conversion basic tutorial
Awk regular expressions, regular operators detailed
Windows7 Ultimate Activation Key Permanent Edition
Win7 using Excel prompt stdole32.tlb lost how to solve?
What if Win7 has no sound? Solution for Win7 system sound disappears
Win7 method for setting folder password
Win7 system security features and features a large collection
How does WinXP system use diskgenius to recover partitions?
How can I solve the problem that Win8.1 cannot change the computer settings?