Is There a UNIX / Linux unerase / undelete Command?

by on March 5, 2008 · 5 comments· LAST UPDATED March 5, 2008

in , ,

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

Tweet itFacebook itG+ itDownload PDF versionFound an error/typo on this page?

{ 5 comments… read them below or add one }

1 wrongloop March 6, 2008 at 4:08 am

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 March 7, 2008 at 9:55 am

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 :( )


3 Theo August 26, 2008 at 6:16 pm

search google for ext3undel


4 paul b January 22, 2010 at 10:59 pm

I tried many GUI shareware and free programs, both windows and linux with no luck. Then found ext2undel and it work great. Almost all 1600 + jpg’s on an USB hard drive easily recovered.


5 Seth October 27, 2011 at 1:12 pm

Short answer – yes.
Download unrm :)


Leave a Comment

Tagged as: , , , , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: