Shredding files on Linux
The rm command easily makes files disappear from our file listings, but what does it actually do and how can we ensure that files are unlikely to be recoverable?
A little background on Linux file removal
To understand what happens when you remove a file from a Linux system with rm, first think about inodes — those intriguing data structures that keep track of all of a file's attributes (often called "metadata") — that describe the file. This includes its name, its owner and group, what permissions have been established, and where the file's contents can be found on the disk.
Next, think about Linux directories. While they take the appearance and character of folders (i.e., merely containers for holding files), they are actually files themselves — files that include no more than the names and inode numbers of the files they "contain." So, what we get is a convenient way to think about directories and files in the same way you might think about the folders and paperwork in your file cabinets (if any of you still have one of those).