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
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 5 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
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.
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 :( )
search google for ext3undel
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.
Short answer – yes.
Download unrm :)