1

I need to delete the following file which I managed to create with bunzip2:

 -rw-r--r--   1 beginner group    67493376 Feb 17 17:30 -C

The following don't work

  • rm -rf '-C'
  • rm -rf "-C"

My OS is solaris.

Beginner
  • 237

1 Answers1

7

Use -- to distinguish between options which start from - and filename or prepend file with ./. The safest is to use both:

rm -- './-C'
jimmij
  • 47,140