Created
          October 16, 2019 11:44 
        
      - 
      
- 
        Save martinhj/78dd8dee064a964db20ec703c32f3d8d to your computer and use it in GitHub Desktop. 
    safe deletion: overwrite file before deletion
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | dd if=/dev/zero of=filewithsecret bs=1 count=12342 conv=notrunc | |
| # ^^^^^- filesize (ls -l filewithsecret) | |
| # ^^^^^- notrunc: do not truncate the file if count is < filesize (do not leave secret bits and bytes hanging around on your disk....) | |
| # Could combine this with a for loop to do it a couple of times if feeling extra | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment