Safe Way to Remove a File

@sf{WWW}: @sf{WWW}:

Once a file is removed, it is permanently deleted and there is no command you can use to restore it; you cannot "undelete" it. (Although if you can unmount the filesystem that contained the file immediately after you deleted the file, a wizard might be able to help reconstruct the lost file by using grep to search the filesystem device file.)

A safer way to remove files is to use del, which is simply an alias to rm with the "-i' option. This specifies for rm to run in interactive mode and confirm the deletion of each file. It may be good practice to get in the habit of using del all the time, so that you don't make an accidental slip and rm an important file.

NOTE: Question 3.6 in the Unix FAQ (see "/usr/doc/FAQ/unix-faq-part3') discusses this issue, and gives a shell script called can that you can use in place of rm---it puts files in a "trashcan" directory instead of removing them; you then periodically empty out the trashcan with rm.

L<J L>J [<<J [-Up] L>>J [Top] [Contents] [Index] [?J

Was this article helpful?

0 0
Computer Hard Drive Data Recovery

Computer Hard Drive Data Recovery

Learn How To Recover Your Hard Drive Data After A Computer Failure.

Get My Free Ebook

Post a comment