Problem removing a file

Ed Horch ebh at argon.UUCP
Sat Feb 4 14:52:56 AEST 1989


In article <154 at conrad.UUCP> sac at conrad.UUCP (Steven A. Conrad) writes:
>Frequently the easiest way is to use the wild character symbol '?'
>in place of any nonprinting characters or characters which would
>otherwise prevent the command from being carried out.

That won't work if you're trying to remove a file named "-ef", for the
same reason that using * doesn't work.  It's the shell that does the
expansion of wild cards, not the rm command itself.  So, if you
specify the file "-ef" as "?ef", the rm command is invoked by the
shell as "rm -ef" after all.  You have to use one of the other tricks
that have been posted here, and also posted in the "Frequently Asked
Questions" article in news.announce.newusers.  To summarize:

	rm ./-ef
	rm -- -ef
	mv -ef foo; rm foo
	cd ..; rm -r directory
	etc.

-Ed



More information about the Unix-pc.general mailing list