rm command problem
Dan Nelson
dnelson at allantgroup.com
Fri Oct 20 16:46:26 UTC 2006
In the last episode (Oct 20), Bill Moran said:
> In response to Efren Bravo <efrenba at yahoo.es>:
> > Accidentally I've created a file called -exclude and now I cann't
> > delete it.
> >
> > I tried with:
> >
> > rm -exclude and rm *exclude but it returns this:
> >
> > rm: illegal option -- -
> > usage: rm [-f | -i] [-dIPRrvW] file ...
> > unlink file
> >
> > How can I delete it?
>
> rm \-exclude or rm '-exclude'
Actually neither of those will work :) If '-' was a wildcard character
interpreted by the shell it would have, but rm is the problem here, not
the shell. You need to either tell rm to ignore leading dashes as
options (using the -- option):
rm -- -exclude
, or move the dash away from the beginning of the path:
rm ./-exclude
--
Dan Nelson
dnelson at allantgroup.com
More information about the freebsd-questions
mailing list