Operating System - HP-UX
1820099 Members
3603 Online
109608 Solutions
New Discussion юеВ

how to remove the file name "-."?

 
SOLVED
Go to solution
Hanry Zhou
Super Advisor

how to remove the file name "-."?

(dash and point)
none
12 REPLIES 12
James R. Ferguson
Acclaimed Contributor
Solution

Re: how to remove the file name "-."?

Hi Hanry:

# rm -i -- -.

Note that the double dashes signal the end of flags and thus the '-.' is the file to remove as you asked.

Regards!

...JRF...
Robert-Jan Goossens
Honored Contributor

Re: how to remove the file name "-."?

Hi,

# rm -- -.

Regards,
Robert-Jan
Jeff_Traigle
Honored Contributor

Re: how to remove the file name "-."?

If you look at the examples in the rm(1) man page, it'll show you how... basically give the full path to the file...

rm /full/path/-.
--
Jeff Traigle
Jonathan Fife
Honored Contributor

Re: how to remove the file name "-."?

If you give two dashes in a standard command it will stop looking for arguments. Thus the following should work:

rm -- -.
Decay is inherent in all compounded things. Strive on with diligence
Sandman!
Honored Contributor

Re: how to remove the file name "-."?

rm -- ./-.

"--" turn off option processing so that rm doesn't get confused between an option and a filename that starts with a dash.
Bill Hassell
Honored Contributor

Re: how to remove the file name "-."?

The simplest is just:

cd /problem_directory
rm ./-

The ./ is a shorthand for the current directory and separates the - from option processing.


Bill Hassell, sysadmin
Arturo Galbiati
Esteemed Contributor

Re: how to remove the file name "-."?

rm -- -.

HTH,
Art
Emil Velez
Honored Contributor

Re: how to remove the file name "-."?

bring up /usr/dt/bin/dtfile and do mousercise.

It should work
Dan Phelps_1
New Member

Re: how to remove the file name "-."?

It should be possible to do so by enclosing the filename in double quotes.

Such as

rm "-."

bhargavi
Advisor

Re: how to remove the file name "-."?

try this command
rm ./-.
Its working.
bhargavi
Advisor

Re: how to remove the file name "-."?

its (point slash dash point)
rm ./-.
Dennis Handly
Acclaimed Contributor

Re: how to remove the file name "-."?

>Dan: It should be possible to do so by enclosing the filename in double quotes. rm "-."

No, this won't work since the shell removes the quotes when passing it to rm(1).