Re: delete linux file that begins with special character
Paul Gear <netlab1 <at> libertysys.com.au>
2011-11-16 21:50:38 GMT
On 17/11/11 07:03, Joe Acquisto wrote:
> Yes, I had tried escaping, etc. no joy.
>
> If the suggestion Joe D made had not worked, I would have tried to fire up
> a gui file manager and a work some visual voodoo.
>
> But, as stated earlier, without his suggestion, it might have been some
> time before it dawned on me that it would offer the file, using the wild
> cards. That's one for near term storage.
Another technique that will nearly always work is using single quotes
(unless the file name itself contains single quotes), because that
prevents all shell variable substitutions, special characters, and
wildcard expansions.
If you ever accidentally create a file beginning with a hyphen, you'll
find that hard to delete as well. The trick in that case is to indicate
the end of the rm options list by using a double hyphen:
rm -- -my-file-name-beginning-with-hyphen-
Paul