[ale] How can I delete this file?

David A. De Graaf dad at datix.2y.net
Wed Sep 8 11:10:54 EDT 2004


On Wed, Sep 08, 2004 at 06:10:51AM -0400, Geoffrey wrote:
> David A. De Graaf wrote:
> >On Tue, Sep 07, 2004 at 08:36:18PM -0400, Christopher Bergeron wrote:
> >
> >>Hrm, neither solution seemed to work.  I'm truly stumped on this one.  I 
> >>have no idea what created these files, I think I cat'ed a binary to the 
> >>console or something.
> >>
> >>Any other ideas?
> >>
> >>Is there a way I can delete the inode(s) without damaging my filesystem?
> >
> >
> >The 'find' command will almost always do this job:
> >
> >First make sure you can concoct a regular expression for the name that 
> >matches only this single file.
> 
> I think this is the heart of the problem, determining the proper RE. 
> Once that's done, I'm not sure what the purpose of 'find' is.  If find 
> matches the filename, then what's wrong with simply executing 'rm filename?'

What I failed to emphasize is that find has a slew of other
exclusionary rules that allow you to select a particular file.
You need not use a regular expression in the -name <RE> option.
You can base the selection on date, size, owner, etc., or various
combinations.  Use any method that ultimately selects just that one file
and then add the -exec rm {} \;  and the job is done.

Find is one of my favorite UNIX commands.  It is very powerful and
flexible, but as always, requires some effort to master.

-- 
	David A. De Graaf    DATIX, Inc.    Hendersonville, NC
	dad at datix.2y.net    (828) 696-8646;  fax (828) 694-1037



More information about the Ale mailing list