About Linux FAQ

Browse More FAQs:

Is There a UNIX / Linux unerase / undelete Command?

Posted by Vivek on Wednesday March 5, 08 @7:02 pm

Q. Is There a UNIX / Linux unerase or undelete command? How do I undelete files under a UNIX / Linux system?

A.. Short answer - no.

There is no "unerase" or "undelete" command in Linux / *BSD / Unix like operating system such as AIX or HP-UX . The best solution is to restore file from a backup. You can also use a data recovery tool but there is no guaranty you will get back the data. Always use following method to avoid problems:
=> Make regular backups and file system snapshots

=> Never ever login as root for non admin related tasks

=> Always use a regular user account for all normal tasks

=> Alias rm / mv / cp command as rm -i / mv -i
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'

=> Make important file copy before editing

=> Use RAID 6 or above hardware card as additional protection for file server

=> Keep files safe from accidental overwriting with noclobber under BASH shell

=> Make a Linux File unchangeable ( unalterable ) so that no one can modify it - including root user

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Linux / UNIX FAQ:

Discussion on This FAQ

  1. wrongloop Says:

    you can also use the -b option when using rm mv or cp
    so that there will be a backup if you want to restore it, if now then you can erase it later when you are sure you won’t use it.

  2. Daniel Says:

    WRONG: never use “alias rm=’rm -i’”. Gives you the habit to use “rm *” all too often. Can be distastrous on accounts where this alias is not defined. (Own experience :( )

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , , , , , , , , , , , ~ Last updated on: March 5, 2008

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.