[PLUG] Reading a file with a dash
Paul Heinlein
heinlein at madboa.com
Tue Jun 29 14:47:09 UTC 2021
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
More information about the PLUG
mailing list