Frequently Asked Questions
1) 3 Ways to Permanently and Securely Delete ‘Files and Directories’ in Linux?
We have three common ways to delete `Files and Directories` permanently and securely in Linux.
- Shred:
shred -zvu -n 4 [file_name]
- -z – adds a final overwrite with zeros to hide shredding
- -v – operation progress is displayed
- -u – removes and truncates file after overwriting
- -n – number of times we want to overwrite file content (the default is 3) we have chosen 4 times in this example.
- file_name = can enter any file you want
- Wipe:
Install wipe tool
#for Debian-baised linux operating system like ubuntu sudo apt-get install wipe #for Red Hat baised linux operating system like RHEL sudo yum install wipe or sudo dnf install wipe
Here is the syntax
wipe -rfi [Directory_name]
- -r – recurse into subdirectories
- -f – forced deletion and no confirmation query
- -i – to see progress of deletion process
To see manual of wipe
man wipe
- Secure-deletion Toolkit:
Install secure-delete
#for Debian-baised linux operating system like ubuntu sudo apt-get install secure-delete #for Red Hat baised linux operating system like RHEL sudo yum install secure-delete or sudo dnf install secure-delete
Here is the syntax
srm -vz [directory_name]
- -v – verbose mode on
- -z – wipes the last write with zeros instead of random data
To see manual of secure-deletion
man srm
2) Does rm delete permanently?
When we delete a file or directory permanently with help of `rm` command, it is for sure deleted. It is somehow possible to recover recently deleted data in this case, if it is not yet overwritten by other data. Once a deleted file or directory is overwritten by data it is kind of impossible to recover the data.
3) What is secure file deletion?
When we delete a file from our system, it is deleted for sure and cannot be seen if we search or find it, but the actual file remains on hard disk after deletion also. So, we have to securely delete our file, directory or critical tasks.
A process of deleting sensitive data and critical tasks, that should not be able to be recovered by anyone after deletion.
Ways to Permanently and Securely Delete ‘Files and Directories’ in Linux
Linux is an open-source operating system that is loved by tech geeks. It is a versatile operating system that can be used on thousands of different hardware configurations. The most interesting feature of Linux is its command line interface. This feature allows you to perform multiple operations within the operating system with just a few commands. One of the most useful commands in the Linux command line is the rm command. You can use this command to delete files and directories within the operating system. But, if you use rm to remove a file, it might be possible to recover some of its contents, given sufficient expertise and time.
So, there are 6 Different ways to Permanently and Securely Delete ‘Files and Directories in Linux.
- Method 1: Shred command
- Method 2: Wipe Command
- Method 3: Using Secure-delete Package ToolKit
- Method 4: SFill (secure free disk and inode space wiper)
- Method 5: Sswap – Secure Swap Wiper
- Method 6: sdmem – Secure Memory Wiper
Let’s Explore one by one: