Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!sdd.hp.com!spool.mu.edu!munnari.oz.au!manuel!cmf851 From: cmf851@anu.oz.au (Albert Langer) Newsgroups: comp.unix.shell Subject: Re: File remove command? Message-ID: <1991Jun17.181558.9562@newshost.anu.edu.au> Date: 17 Jun 91 18:15:58 GMT References: <3431@crdos1.crd.ge.COM> <922@visenix.UUCP> Sender: news@newshost.anu.edu.au Organization: Computer Services Centre, Australian National University, Canberra, Australia. Lines: 31 In article <922@visenix.UUCP> beattie@visenix.UUCP (Brian Beattie) writes: >If the real aim is to remove the data how about: > >cat /dev/null >offendingfile >rm offendingfile > >This may leave the inode if links exist but the file will >have been truncated to zero length i.e. no data. Does this also get rid of the data from the original file system blocks so they cannot be reconstructed with a file system debugger? I imagine it doesn't. That may not be the original question but I'd be interested in a simple shell way to do so. I assume that using cp to write a larger file full of meaningless data over the original file would work. Or might that result in a new file on some systems, with the original blocks just freed? I know it isn't as big a problem with unix, since deallocated blocks tend to be very hard to track down and get immediately reused anyway, but a simple equivalent to Norton's wipefile under DOS would still be useful and I'm sure it should be a simple shell one-liner (portable across all reasonable unixes). How does one fill a file with zeroes or whatever in as few keystrokes as possible? ed? -- Opinions disclaimed (Authoritative answer from opinion server) Header reply address wrong. Use cmf851@csc2.anu.edu.au