How do you overwrite the contents of a file without changing the file size?
We have some large files with sampling data in it.
Don't want to delete these files. But want to quickly overwrite the file with 0s and/or 1s and preserve the original file size. |
Looks like the ideal job for a secure deletion prog... you can use wipe with these args: 'wipe -ZFke <filename>'
cheers |
text data or binary?
For a text file: Use SED to replace every character with something. Text or binary: If you know the size of the file, then use dd to write all zeros to it. example: Write all zeros to the file "mystuff": Code:
filesize=$(stat -c %s mystuff) |
'shred' will work as well.
|
All times are GMT -5. The time now is 04:43 PM. |