Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Apr 1998 07:57:07 -0700
From:      "Randy A. Katz" <randyk@ccsales.com>
To:        Randall Hopper <rhh@ct.picker.com>, Andrew <andrew@iaccess.com.au>, freebsd-questions@FreeBSD.ORG
Subject:   Re: How To Delete Certain Files
Message-ID:  <3.0.5.32.19980422075707.03482210@ccsales.com>
In-Reply-To: <19980422105204.A24838@ct.picker.com>
References:  <008a01bd53ac$8dd26c60$e34a05cb@alpine.iaccess> <008a01bd53ac$8dd26c60$e34a05cb@alpine.iaccess>

next in thread | previous in thread | raw e-mail | index | archive | help
I wasn't going to say this publicly on the list but here it goes:

This is the first answer that will work. I got plenty of answers that would
result in the toasting of the directory (no, I didn't toast it, I'm not
that glib, I tested on a make believe directory first).

I think it is very important in computing that when you answer a question
you either qualify that you've tested it (or not).

Thanx for all your efforts,
Randy Katz

At 10:52 AM 4/22/98 -0400, Randall Hopper wrote:
>Andrew:
> |Randy Katz <randyk@ccsales.com>:
> |>Hello,
> |>
> |>I have files that are named:
> |>
> |>-p
> |>--exclude
> |>
> |>How would I go about removing them?
> |
> |try this
> |
> |rm -rf "--exclude"
> |rm -rf "-p"
>
>
>I don't think this will work.  What you want is:
>
>     rm -- --exclude -p
>
>"--" terminates argument processing so that "rm" doesn't think anything
>else after that beginning with a "-" is an option.  This should work with
>most system commands.
>
>Alternatively, change the filename so that it doesn't start with a -.  E.g.:
>
>     rm ./--exclude ./-p
>
>Another option.  Put a filename that "doesn't" begin with a dash (possibly)
>before the ones that do.  E.g.:
>
>     rm abcdef --exclude -p
>
>Randall
>
>
>

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.5.32.19980422075707.03482210>