[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: debian-user-digest Digest V2011 #1215



> > On 25/06/11 17:15, Andrew McGlashan wrote:
> > > Hi,
> > > 
> > > Ralf Mardorf wrote:
> > >> $ echo test > \*
> > >> $ ls
> > >> *  Desktop  Downloads  hdsp.1
> > >>
> > >> Any idea how I can get rid of the file named *?
> > > 
> > > #  touch \* \&
> > > #  ls
> > > *  &
> > > #  find . -type f -name "\*" -print0|xargs -0 rm
> > > #  ls
> > > 
> > > 
> > > #  touch \* \&
> > > #  find . -type f -name "\&" -print0|xargs -0 rm
> > > #  ls
> > > *
> > > 
> > > 
> > > #  touch \* \&
> > > #  ls
> > > *  &
> > > #  find . -type f -name "\&" -print0|xargs -0 rm;ls
> > > *
> > > #  find . -type f -name "\*" -print0|xargs -0 rm;ls
> > > 
> > > 
> > > Cheers
> > > 
> > 
> > Bigger hammer....
> > 
> > scott@work:~/spec$ touch "*" "&"
> > scott@work:~/spec$ ls -A
> > *  &
> > scott@work:~/spec$ rm `ls -A`
> > rm: cannot remove `&': No such file or directory
> > scott@work:~/spec$ ls -a
> > .  ..
> > 
> > 
> > Cheers

Hehe, I'm jobless (= having more time) and pissed (by wine, not the
software, but the drink) at the moment, that's my excuse to do similar
experiments. What's your excuse ;D?

I guess I stop now, to avoid that I randomly run

$su
# cd /
# rm *

and then need to restore backups.

Globbing can be very entertaining, but before we go on writing mails
regarding to funny issues, we should add a note, to prevent very
inexperienced Debian users against disasters.

2 Cents,

Ralf


Reply to: