How is rm command different from the delete button?

Solution 1:

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.

Solution 2:

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.