Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!visenix!beattie From: beattie@visenix.UUCP (Brian Beattie) Newsgroups: comp.unix.shell Subject: Re: File remove command? Message-ID: <922@visenix.UUCP> Date: 16 Jun 91 14:38:12 GMT References: <3431@crdos1.crd.ge.COM> Reply-To: beattie@visenix.UUCP (Brian Beattie) Organization: Department of Redundancy Department Lines: 28 In article <3431@crdos1.crd.ge.COM> davidsen@crdos1.crd.ge.com (bill davidsen) writes: ->Has anyone written a remove command which will unlink all links to a ->file inode when the command is issued on any one name? Yes I know it's ->dangerous, but there are times when I want certain data unconditionally ->off my system. 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. To all nitpickers yes with some shells you can replace the cat command with: >offendingfile and if you do not know why that is not portable you should not try to correct me. The other solution is to use ncheck to find all links to said file NOTE if a process has the file open even that will not actually get rid of the inode. -- It is easier to build a | Brian Beattie (703)471-7552 secure system than it is | 11525 Hickory Cluster, Reston, VA. 22090 to build a correct system.| M. Gasser | ...uunet!visenix!beattie