Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Operating System - Tru64 Unix
cancel
Showing results for 
Search instead for 
Did you mean: 

File with the name of '-.'

SOLVED
Go to solution
Victor Semaska_3
Esteemed Contributor

File with the name of '-.'

Greetings,

I thought I saw an thread about this type of problem before but can't find it.

On a DS25 running V5.1B Patch Kit 4 there's a file with the name of '-.'. I can't delete. Anyone know how to do this?

# ls -l
-rwxr-xr-x 1 obanner sysodba 10240 Jan 5 2004 -.

# rm '-.'
rm: illegal option -- .
usage: rm [-efirR] file ...

# rm -e "-."
rm: illegal option -- .
usage: rm [-efirR] file ...

Thanks,
Vic
There are 10 kinds of people, one that understands binary and one that doesn't.
4 REPLIES
Mark Poeschl_2
Honored Contributor

Re: File with the name of '-.'

Couldn't get anything from the shell to work, but this C code worked for me:

#include
#include
#include
main ()
{
char name[5] = "./-.\0";
int desc;

desc = unlink (name);

}
Hein van den Heuvel
Honored Contributor
Solution

Re: File with the name of '-.'

just use a double-dash (--) to stop option parsing.
So the solution would be:

rm -- -


or


rm ./-


or

find . -name "-" -exec rm {} \;


Hein.

Victor Semaska_3
Esteemed Contributor

Re: File with the name of '-.'

Thanks,

The '-- -.' & './-.' both worked.

Vic
There are 10 kinds of people, one that understands binary and one that doesn't.
Victor Semaska_3
Esteemed Contributor

Re: File with the name of '-.'

See above.
There are 10 kinds of people, one that understands binary and one that doesn't.