Ryan Flannery wrote:
> On Thu, May 14, 2009 at 11:42 PM, Tony Abernethy 
> <[email protected]> wrote:
> > Ryan Flannery wrote:
> >> On Thu, May 14, 2009 at 10:53 PM, Jordi Beltran Creix
> >> <[email protected]> wrote:
> >> > rm `ls | grep E` would delete that file leaving others alone.
> >> >
> >> > Regards,
> >> >
> >>
> >> Just for the list...
> >> I had tried that incantation, and others involving grep, and
> >> they all failed.
> >>
> >> Output (I just reproduced the file) from your example is:
> >>
> >> tarski> wget ftp://rt.fm/pub/OpenBSD/snapshots/ports.tar.gz
> >> ...(wget output)...
> >> tarski>  tar xf ports.tar.gz
> >> ...(tar output, lots-o-errors, obviously)...
> >>
> >> now the file exists with the mucked-up name (see previous 
> post for how
> >> ls(1) displays it)
> >> and here's what happens when I use the "rm `ls | grep E`" you
> >> suggested (and I tried earlier... again with many variations)
> >>
> >> tarski> rm `ls | grep E`
> >> ~,u?} w=R1 T)U7r 5\4gm(_EW]W-sn^[[?1;2c: No such file or directory
> >>                   Ec?J9 K%Mx/!...@s S,W7g?5
> >> 0,z: No such file or directory             
> M}OWDt?Yw?rB~[*6t?0h|7<aBz_
> >> tarski>
> >>
> >
> > You might try something like
> > mkdir /usr-new
> > mv /usr/[a-z0-9A-Z]* /usr-new
> > ls -l /usr
> >
> > AFTER EVERYTHING mentionaable has been moved
> > rm -rf /usr
> > mv /usr-new /usr
> 
> I thought about this... moving everything out of /usr so I could just
> delete the mischievous file's parent directory, which would certainly
> have worked.
> 
> The /usr slice is quite hefty, and the time to move everything to a
> new partition would have been a while... I kept trying to find another
> way around this (which probably took way longer than it would have to
> just copy everything out of /usr to a new partition  :)
> 
Out of curiosits, what does 
ls -il /usr/*w=R1*
ls -il /usr/[^a-zA-Z0-9]*
produce?

You might get it with a pattern that gets nothing of value.
rm -f /usr/[^a-zA-Z0-9]*

Reply via email to