Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!convex!usenet From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.shell Subject: Re: File remove command? Message-ID: <1991Jun17.130243.14315@convex.com> Date: 17 Jun 91 13:02:43 GMT References: <3431@crdos1.crd.ge.COM-> <8725@jhunix.HCF.JHU.EDU> Sender: usenet@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 20 Nntp-Posting-Host: pixel.convex.com From the keyboard of doug@jhunix.HCF.JHU.EDU (Douglas W O'neal): :How about :find / -inum `ls -i foo | awk '{print $1}' -` -exec rm -f {} \; -print Remember inumbers are unique to the file system. You don't know that foo is on the root file system. This way you'll unnecessarily traverse the whole file. I might do this, at least on my system: (assume $file is the name of the file, and valid) find `df $file | awk 'NR ==2 {print $6}'` \ -xdev \ -inum `ls -i $file | awk '{print $1}'` \ -exec /bin/rm {} \; \ -print --tom -- Tom Christiansen tchrist@convex.com convex!tchrist "So much mail, so little time."