0

Possible Duplicate:
How can I securely erase a hard drive?
How to delete file(s) in secure manner?

I've got an older computer with an 80 GB hard drive. I'm trying to keep the hard drive as clear as possible and delete any downloaded files that I no longer need. I was just wondering, if I delete a file (which sends it to the trash bin) and then empty the trash bin, does that completely delete the file off the hard drive? If not, is there a good way to clean up the hard drive from time to time without erasing necessary programs?

2
  • @UriHerrera Not really a dupe of that question as that concerns complete devices. However answers there might apply to individual files too. Moreover, I think OP is not too concerned about security in this, but just trying to save disk space.
    – gertvdijk
    Jan 2, 2013 at 3:30
  • Are you asking how to make sure the data can not be recovered even by forensic methods, or you just want to make sure the space is freed?
    – psusi
    Jan 2, 2013 at 3:42

2 Answers 2

3

If my understanding is correct, when you empty the trash can all the files in it are completely deleted.

If you want to make sure that a file is deleted, you can delete files using the rm command, although this is dangerous, as you can easily break your system or delete many files if you accidentally mistype this command.

If you want more info on rm, look on its manpage.

3
  • 3
    Deleted as in unlinked. With data recovery applications it is still possible to retrieve (parts of) their content, for a fair amounts of cases.
    – gertvdijk
    Jan 2, 2013 at 3:32
  • Also, if hardlinks exist, the (contents of) file is not removed at all using rm, but just one reference to it is removed.
    – gertvdijk
    Jan 2, 2013 at 10:18
  • That's true, I suppose the way to technically completely remove something would be to use a command like shred, although the manpage says that shred doesn't work well on some hard drive formats, including Ext3. Likewise, shred should be used with the utmost care.
    – ananaso
    Jan 2, 2013 at 12:54
1

Yes. The answer to your question is yes. If you delete the files from the Trash , then the files no longer occupy a space in your HDD.

If you want to make a safe cleaning to the Operating System , then you can apply the commands below from time to time.

sudo apt-get --purge autoremove
sudo apt-get clean
sudo apt-get purge $(dpkg -l | awk '/^rc/ { print $2 }')

1st command will delete all unwanted packages.

2nd command will clean up the apt-cache

3rd command will delete unwanted files (e.g packages you have deleted and configuration files are still in system)

Not the answer you're looking for? Browse other questions tagged .