2

I try to delete this file on my solaris machine

rm "-Insi"

rm: illegal option -- I
rm: illegal option -- n
rm: illegal option -- s

I also try this

 rm "\-Insi"

 -Insi: No such file or directory


 rm '\-Insi'

 -Insi: No such file or directory

so what other option do I have?

maihabunash
  • 7,131
  • Can you post the output of the ls here? – GMaster Mar 22 '15 at 12:29
  • My immediate reaction was that we must have covered this before, given how often people ask it. According to http://unix.stackexchange.com/questions/185520/ we've had it at least twice before; once even specifically talking about Solaris. ☺ – JdeBP Mar 22 '15 at 16:06

2 Answers2

7

Try:

rm -- -Insi

or:

rm ./-Insi
cuonglm
  • 153,898
2

man rm (at least on Ubuntu ... my Solaris box is not plugged in) tells me this:

   To remove a file whose name starts with a '-', for example '-foo',
use one of these commands:
      rm -- -foo

      rm ./-foo

Skaperen
  • 716