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=R1T)U7r5\4gm(_EW]W-sn^[[?1;2c: No such file or directory
>                   Ec?J9K%Mx/!...@ss,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

Reply via email to