unescaping special characters

how do i unescape special characters in Unix.

Suppose i've a file named -xyz.txt, how do I remove the file.
Ofcourse Icant give rm -xyz.txt thats not gonna work.
We can go in regular expression like this ls | grep -e '-'xyz.txt | rm; but I'd like to know any simpler way than this.

Thanks for the guys posting in their suggestions.

for the case where you want ro remove a file beginning with a -, e.g -xyz you can do

rm -- -xyz

the -- (double hyphen) indicates that the following args are not to be interpreted as options but should be taken literally.

HTH

And just to make it clear - that is not a space between the dashes... copy/paste it to see the format clearly :slight_smile:

Escaping special characters (at least in SED), is the foward slash key '\''

e.g. http://
=
http\:\/\/website.com\/