[PLUG] Reading a file with a dash

Michael Barnes barnmichael at gmail.com
Wed Jun 30 03:05:54 UTC 2021


On Tue, Jun 29, 2021 at 7:47 AM Paul Heinlein <heinlein at madboa.com> wrote:

> On Tue, 29 Jun 2021, Michael Barnes wrote:
>
> > Somehow, I managed to create a file named -u. I cannot figure out how to
> > look at it as any command I give thinks -u is an option, not the
> filename.
> >
> > I cannot read, edit, move, delete, or anything.
> >
> > Ideas appreciated.
>
> Most GNU utilities will stop interpreting options when they encounter
> a bare ' -- ' string. So this should work
>
> mv -- -u newfilename
>
> Or, just use the . directory in the filename:
>
> less ./-u
>
> --
> Paul Heinlein
> heinlein at madboa.com
> 45.38° N, 122.59° W


Paul got it, although I figured it out about ten minutes after I sent my
request.
less ./-u did the trick.

Thanks,
Michael



More information about the PLUG mailing list