Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I delete folders or files in the Nautilus GUI, those folders/files go to Trash but where do folders/files go when I run rm -rf folder_or_file_name in terminal in Ubuntu 10.04?

share|improve this question

As far as I know a 'rm' command completely removes files and directories. There are "undelete" options, but there is no such thing as a "Trash" or "Recycle Bin"

share|improve this answer

From the man page:

Note that if you use rm to remove a file, it is usually possible to recover the contents of that file. If you want more assurance that the contents are truly unrecoverable, consider using shred.

I believe that rm -rf simply removes the link to the file. In other words, it doesn't write the file over with 0's or anything (which is what I'm assuming shred does), but it makes the file unable to be found without special tools.

If you're hoping that the files go to some other kind of trash / recycle bin though, I'm afraid you're out of luck. rm -rf is pretty much the universal "make sure you know that this will get rid of your files no second chance" command.

share|improve this answer

John is correct. When you do an rm, it removes the directory entry which points to the file. The file's contents are still on disk, but have no associated entry. The contents will remain on disk until the blocks containing those contents are reused. This could be almost immediately, or could be never, depending on the type of disk, the disk firmware, and the number of writes to the disk.

If you have inadvertently deleted a file and want to recover it, first find out what your filesystem type is. You can do this by typing 'mount' and then looking at the 'type' field. I don't know what Ubuntu uses by default, but it will probably be something like ext4 or (if you're lucky) ext3.

Then do a Google search for "undelete " If you discovered that your filesystem is ext4, you will search for "undelete ext4". Choose whichever tool looks the least sketchy and then try using it.

share|improve this answer

It's quite similar to the shift-Delete except that they still exist temporarily on disk but not referenced so you physically can't find them. They will eventually be replaced but something else. I agree with John and this last Guy.

share|improve this answer

Your Answer


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.