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?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
maihabunash
  • 6,973
  • 19
  • 64
  • 80
  • 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
  • 150,973
  • 38
  • 327
  • 406
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
  • 706
  • 1
  • 5
  • 14