On Thu, 4 Jul 2002, Simon Bryan wrote:

> Hi all,
> Can anyone tell me why:
>
> rm DF21304_Family Statement - *
>
> matched all files starting with DF? It was either that one or:
>
> rm "DF21304_Family Statement - Alphabetical.c7report"
>
> and has left me in deep doggy doo doo??

rm accepts multiple arguments for the name of the file to delete.

Because you've got spaces in your filename, it'll have deleted everything
which starts with

DF21304_Family
Statement

and worst of all

* (I.E. everything)

Mind you, I'd expect that the command _should_ have errored because you
had a "-" in the middle of it - it should have accepted the next option as
an argument, not part of a filename.

Except I just tested it, and it went back to my home directory and deleted
everything. Whups. :-) Foolish me. There's obviously something in that
{maybe the - *} bit which sends it back to your home dir and deletes
everything.

You should have done

rm "DF21304_Family Statement - *"

And I should have never attempted to test it. :-)

DaZZa

-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to