Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I read from a book where it says, the command rm deletes the inode and not the file. Which means if I delete with the rm command, then it cannot be restored.

I'm very new to Ubuntu environment. Now my doubt is, how does the Del key works? It is not deleting the inode as far as I am concerned, because I can restore it from my Trash folder. So am I right to say that Del key is doing a mv command to Trash folder leaving the inode unchanged? Or am I missing something here?

share|improve this question
add comment

2 Answers 2

up vote 8 down vote accepted

Your understanding is essentially correct - the Del key as used in Nautilus (or other file manager) is NOT the same as using rm; it "moves" the file to Trash instead so that it can be recovered unless you Empty Trash (which is the same as rm).

Note that even if you rm a file, the actual data is still on the disk after the inode is deleted. If you act immediately before the data is eventually overwritten, you can still recover the data using a tool such as testdisk/photorec.

share|improve this answer
    
Thanks for the answer. Can you provide a bit more explanation on the actual data is still on the disk after the inode is deleted. This line? So when it will be deleted? I mean on what condition the system/kernel deletes the data? –  Ant's Aug 12 '12 at 12:01
3  
The system does not delete data; at some point it will just re-use that space as it is seen as 'unused' to the system @Ant's But techically the data is still there; it is just that the reference (inode) to that file is deleted. –  Rinzwind Aug 12 '12 at 12:14
    
@Rinzwind: Clean. Thanks for the explanation. –  Ant's Aug 12 '12 at 12:17
    
I'm not sure about your exact distro, but in kubuntu, shift+del is the same as rm. –  Joe Aug 16 '12 at 7:16
add comment

Delete just transfers the files / folders (things you have deleted) to the trash, while "rm" command permanently removes that thing/s from your hard disk.


NOTE : You can still recover permanently deleted files. To "not" do that you will have to shred the file so that it cannot be recovered.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.