Date: Tue, 1 Mar 2005 13:27:11 -0800 From: Joshua Tinnin <krinklyfig@spymac.com> To: freebsd-questions@freebsd.org Subject: Re: dir ~ Message-ID: <200503011327.12183.krinklyfig@spymac.com> In-Reply-To: <200503011518.35088.kirk@strauser.com> References: <20050228165856.D333143D5F@mx1.FreeBSD.org> <plop858y57md1w.fsf@gnu-rox.org> <200503011518.35088.kirk@strauser.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 01 March 2005 01:18 pm, Kirk Strauser <kirk@strauser.com>
wrote:
> On Tuesday 01 March 2005 12:33, Xavier Maillard wrote:
> > My best bet on this issue is to list this by inode -i.e. ls -i
> > and then track this inode using the inum switch of the find
> > command to delete the item.
>
> Ouch. "rm -- fileWithWeirdName" is usually a lot easier. For
> example, if you create a file named "-", then "rm -- -" will get rid
> of it.
I don't think this will work in his example. The man page explains it
like this:
The rm command uses getopt(3) to parse its arguments, which allows it to
accept the `--' option which will cause it to stop processing flag
options at that point. This will allow the removal of file names that
begin with a dash (`-'). For example:
rm -- -filename
So, `--' only causes it to stop processing flag options, not shell
expansion. `~' is not a marker for a flag.
- jt
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200503011327.12183.krinklyfig>
