Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Somehow a file named -]???????q got created on my terminal. I tried rm -f "-]???????q" (in double quotes), but it did not get deleted. (Error:: rm: invalid option -- ]). How do I delete it?

share|improve this question
I had similar problem, in my case the problem was with samba implementation, just try to ssh to server and then remove it – Buksy Apr 5 at 8:43
up vote 14 down vote accepted

For example, with:

rm -- '-]???????q'

Where -- means: "stop parsing options".

share|improve this answer
thanks, works fine! – JP19 Jan 6 '11 at 15:49
Indeed, I ran into a similar problem not even thinking about - being a switch. I swear I spent like 2 hours trying to figure it out. – Jeff F. Jan 6 '11 at 17:11
Many applications use --, guess it's a kind of de facto standard due to the getopt function. – cYrus Jan 6 '11 at 18:42

You can either use the file name with rm or the inode number with find like :

rm -- -]???????q
# or
  -> ls -i                                                                                                                         
47984689 blah.ui  47983771  
47983773 testpy.e4p  47985161

  -> find -inum 47983773                                                                                                           

  -> find -inum 47983773 -exec rm -i '{}' \;
  -> find -inum 47983773 -delete
share|improve this answer
Add -maxdepth 1 otherwise find will iterate through all subdirectories: find -maxdepth 1 -inum 47983773 -delete – Fabian Ritzmann Apr 12 at 7:33


rm ./"-]???????q"

double quotes prevent the shell from expanding interrogation marks; for example, if you had another file called -]foobar.q:

$ touch ./"-]???????q" ./-]foobar.q
$ echo ./-]???????q
./-]foobar.q ./-]???????q
share|improve this answer
+1: Right, the quoting is desirable. – cYrus Jan 6 '11 at 18:44
Oh. I put the quotes, but was missing the ./ – JP19 Jan 7 '11 at 4:35

Your Answer


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