Linux how to delete an important file

Linux how to delete an important file

This article is about deleting important files and assumes that the operating system is Linux.

Deleting important files the right way

We all delete tons of data but when it comes to deleting important data, the task needs to be done right. As many startups, we use Linux extensively because it offers all the right tools for startups. Creating content is the name of the game and sooner or later, we learn the importance of keeping things tidy.

Being organized means to back up on a regular basis and deleting the junk that is no longer of value. Sensitive and important data can not simply be deleted and therefore, special steps must be taken to make sure that there is no way to recover anything.

Why is this important?

Back in 2009, like many, I too bought an iMac. It was an amazing machine and the all-in-one setup seemed nice. And nice it was. Inexpensive apps such as Pixelmator and Cyberduck made web design a joy. This was especially true since I moved from Windows to OSX. After a few years, out of the blue, the screen went dark and I was not able to fix the issue. I tried everything and then some because I had to avoid dropping off the machine at the repair shot at all costs.

Why? Simple. The computer had all the web logins saved and not only that, it also gave anyone who could log in access to all the email accounts. Most of the email accounts were used for client communications and included payment details and asset exchanges for the purpose of client approve and so on. I think you get the picture. As soon as you drop off a computer at any repair department, you will need to provide the administrator login details.

Luckily, I knew of a workaround. I was able to delete much of the important data after I created a last round of backups. This was possible via an SSH (secure shell) remote log in from a Linux box. This happened many years ago and I remember that it took me many hours to make the iMac safe enough to be dropped off at the Genius Bar.

Deleting sensitive information

I think you understand that computers are not 100% dependable. Those of us who create valuable assets understand the importance of daily backups and keeping our work environment tidy. Just like the office needs to be dusted every few days, the hard drives need to be “dusted” as well. 90% of everything I do is created on my main workstation which (now) runs ArcoLinux. My most important file is a text file that holds all the web logins and email passwords.

Updating sensitive data

I hope that you change your email passwords from time to time. If you do, then you know that you also must update your local copy of the text file which holds all the sensitive information. When a design contract ends, some of those text files are no longer needed and therefore must be removed which brings us back to the topic of doing so in a secure manner.

Here is the magic command:

shred filename

Shred Man Page

What does “shred” do? Just like a real shredder rips up paper sheets, the “digital” shredder rips up a saved text file. Examine the image at the top of this post to see what a shredded file looks like. Basically, after shredding a file, it becomes unreadable garbage. Once you have shredded all the files you no longer want, you can simply delete them.

Shred and delete

If you just delete a file, it will stay on the hard drive and most recovery tools can pace it together which is why we shred the data before hand. If you follow the shred and delete work flow, then you can rest assured that should worse come to worse and your computer has to go in for repair, you are safe.

In the past, I had a laptop hard drive fail and although the machine was still under warranty, I declined the free repair. The reason my decision was simple. Most computer manufactures will keep the hard drive and might examine it why it failed so that they can improve the product. OK, maybe this is not true since manufacturing decisions are driven by saving money where ever and when ever possible. Because of that, we get average products at a good price.


  • Always shred your files before you delete them
  • Always keep your system clean because you can never know when a component fails

The above points should teach you that computers are amazing as long as they work. Once one fails, things get complicated fast. Therefore, external backups are a must. If you happen to use Linux, then Timeshift is a robust solution to take care of the backup process. Just make sure that all your sensitive data is encrypted. If you need to read the text, then shred it after you are done. Don’t forget because if you do, it could be costly.

Leave a Comment