Question about cat /dev/zero > zerofile; rm zerofile

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
canam101

Question about cat /dev/zero > zerofile; rm zerofile

Post by canam101 »

Each night, my scheduler, kalarm, runs the command cat /dev/zero > zerofile; rm zerofile

As I understand it, this really deletes all of the deleted but potentially recoverable files in /home/user.

My question is, does it also delete the recoverable files in the directories and sub-directories in /home/user? If it does not, is there some command I can run that will do that?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Bill Gates

Re: Question about cat /dev/zero > zerofile; rm zerofile

Post by Bill Gates »

Yes, that command will overwrite all the removed files on your partition with zeros.

I'm pretty sure that it isn't totally impossible for somebody to recover the files after your overwrite them, but that should make it a lot more difficult.
canam101

Re: Question about cat /dev/zero > zerofile; rm zerofile

Post by canam101 »

Thank you.
Locked

Return to “Beginner Questions”