File remove command?

Douglas W O'neal doug at jhunix.HCF.JHU.EDU
Mon Jun 17 22:22:05 AEST 1991


In article <3431 at crdos1.crd.ge.COM-> davidsen at 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.
->
->Example:
->  $ mkdir foo
->  $ cd foo
->  $ date ->x1
->  $ ln x1 x2
->  $ remove x1	# this is the one
->  $ ls
->  $
->-- 
->bill davidsen	(davidsen at crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
->        "Most of the VAX instructions are in microcode,
->         but halt and no-op are in hardware for efficiency"

How about 
find / -inum `ls -i foo | awk '{print $1}' -` -exec rm -f {} \; -print

Doug
-- 
Doug O'Neal, Distributed Systems Programmer, Johns Hopkins University
doug at jhuvms.bitnet, doug at jhuvms.hcf.jhu.edu, mimsy!aplcen!jhunix!doug 
Like many of the features of UNIX, UUCP appears theoretically 
unworkable... - DEC Professional, April 1990



More information about the Comp.unix.shell mailing list