Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So, on a CentOS box, I accidentally executed :w<Down> in a vim editor, with "<Down>" being literally pressing the down arrow key on the keyboard (rendered onscreen as "<Down>"), and now I have a file named "<Down>" which I can't seem to get rid of; running "rm <Down>" (literally spelling out "less-than, D, o, w, n, greater-than") gives a syntax error.

How can I get rid of this file with the funky name?

share|improve this question
up vote 12 down vote accepted

Use singlequotes to keep the control characters from being processed:

rm -f '<Down>'
share|improve this answer
We have all ran into this issue at some point when we first started out with linux. I for the longest time had trouble editing files with spaces in the name until I realized I could just put quotes around it. – The Digital Ninja Jul 15 '10 at 19:33

Use \ to escape special characters. In this case, you would use

rm \<Down\>
share|improve this answer

As an alternate solution:

$ ls -il .
total 0
1439039 -rw-r--r-- 1 medina foo 0 2010-07-15 16:48 ?????

$ find . -inum 1439039 -delete
share|improve this answer

The easiest way I found to deal with all cases of escaping is using a scripting language:

$ cd /tmp/test/
$ ls
$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.unlink('<Down>')
>>> quit()
$ ls
share|improve this answer

type rm <D and then press TAB , it will show suggestions, for the name of the desired file..

share|improve this answer
I deleted your duplicate answer - 'interesting' choice of icon by the way... – Chopper3 Jul 16 '10 at 14:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.