If you rum rm command accidentally and deleted important a file, recovery becomes critical under Linux and/or UNIX oses. Since Linux is multiuser and multitasking operating system other users/process can overwrite deleted file disk space. So you need to take down system to single user mode. First use wall (only the super-user can write on the terminals of users) command write a message to all users, then use init (process control initialization) command to take system to single user mode. ProcedureFollowing are generic steps to recover text files. First use wall command to tell user that system is going down in a single user mode: System is going down to .... please save your work. Press CTRL+D to send message. Next use init 1 command to take system to a single user mode: Using grep (traditional UNIX way) to recover filesUse following grep syntax:
To recover text file starting with "nixCraft" word on /dev/sda1 you can try following command: Next use vi to see file.txt. This method is ONLY useful if deleted file is text file. If you are using ext2 file system, try out recover command. . See also:
------------------------------------More reference using grep command, unnecessary data which matches with the given string will added in the output file. so i thing it is not good method to restore deleted files ------------------
|
手机版|小黑屋|BC Morning Website ( Best Deal Inc. 001 )
GMT-8, 2025-8-26 05:09 , Processed in 0.014224 second(s), 19 queries .
Supported by Best Deal Online X3.5
© 2001-2025 Discuz! Team.