How to do wrongly delete the file? Master teaches you how to recover

  

No matter what kind of system you use, in short, the system always needs to store a lot of files. In the process of cleaning up the system, we inevitably delete some files because of some minor problems. What should we do then? Today, I will teach you how to handle it under the Linux system.

The server accidentally deleted the /usr/bin and /usr/sbin directories, and then copied the two directories from other places, and found that many of them may be non-normal files such as links, and can be copied when linking. The processing does not know what parameters should be added, so more than one hundred megabytes of things copied nearly one G; finally, give tar a bit, copy.

This way, the server is basically done, it is recommended:

1. Do not log in directly with root, especially unfamiliar people.

2. It is recommended to use sudo to execute the root privilege command, use less su;

3. Use visudo to configure the root privilege command to be executed

eg:xxxALL= /sbin/mount, /sbin/unmount, /sbin/ifconfigNOPASSWD:ALL

The rm command does not work; however, there is a "sequel" <;

1. When logging in, 'linux' :unknownterminaltype;

2. When using top, clear (known), because of terminaltype problem;

3.vim is also a similar problem, not operational; solved, but can only use basic mode ;

4.tftp, telnet service, has been resolved.

The steps are very clear, is it very easy, accidental deletion is not a big thing, many users think that deleted things can not be restored, in fact, everyone does not know the method, today I know Let's go try it.

Copyright © Windows knowledge All Rights Reserved