Okay, when you accidentally type
Your file are gone, can’t resume it at trash, there are no trash, the document are important to you! Oh My God!! you smack your box!
In Linux, you can change attribute for your files and folders, to make it immune from accidental deletion, not even with root permission. To do this art, you need two things.
2. root access or sudo.
Let say I have a folder call “darling”
sudo chattr +i darling
By enable “immunity” (+i) to “darling”, the entire folder can’t be delete by just using rm even you are root. The files and sub folders inside “darling” can’t be delete as well. You cannot create files or sub folders in “darling” too.
If you want to change back to normal, take away her “immunity” (-i).
sudo chattr -i darling
Besides adding “immunity”, chattr can do more, read the full manual to know more.