Every day we are deleting files for different reasons, so we are moving them to trash, but it's only away from our folder, not from our computer/laptop.
So what we can do in Linux to remove it permanently?
Maybe you heard about "Zero Filling", it's a method to overwrite something with zeros. It is often used by formatting (f. e. DBAN), and also the process can not be undone.
A tool called shred can help us in this case.
Our file is photo.jpg.
-v = verbose output
-f = change permissions to allow writing
-z = add a final overwrite with zeros to hide shredding
-u = deallocate and remove file after overwriting
And you can try to recover it, but it's impossible.
So what we can do in Linux to remove it permanently?
Maybe you heard about "Zero Filling", it's a method to overwrite something with zeros. It is often used by formatting (f. e. DBAN), and also the process can not be undone.
A tool called shred can help us in this case.
Our file is photo.jpg.
Code:
$ shred <options> <file>
-v = verbose output
-f = change permissions to allow writing
-z = add a final overwrite with zeros to hide shredding
-u = deallocate and remove file after overwriting
Code:
$ shred -vfzu test1.png
shred: test1.png: Durchgang 1/4 (random)...
shred: test1.png: Durchgang 2/4 (random)...
shred: test1.png: Durchgang 3/4 (random)...
shred: test1.png: Durchgang 4/4 (000000)...
shred: test1.png: wird entfernt
shred: test1.png: in 000000000 umbenannt
shred: 000000000: in 00000000 umbenannt
shred: 00000000: in 0000000 umbenannt
shred: 0000000: in 000000 umbenannt
shred: 000000: in 00000 umbenannt
shred: 00000: in 0000 umbenannt
shred: 0000: in 000 umbenannt
shred: 000: in 00 umbenannt
shred: 00: in 0 umbenannt
shred: test1.png: entfernt
And you can try to recover it, but it's impossible.