6

Possible Duplicate:
How do I delete a file whose name begins with “-” (hyphen a.k.a. dash or minus)?

This is an awkward one, I have received some files from a windows machine which have been named things like

"----index.html"

When I try to grep hello * in a directory containing these files I get grep errors and when I try to mv ----index.html index.html there are similar errors:

mv: unrecognized option '----index.html'
Try `mv --help' for more information.

Can anyone shed any light on this?

Thanks

Kilizo
  • 161
  • 1
  • 4

3 Answers3

10
mv -- ----index.html index.html
grep hello -- *
Bill Lynch
  • 290
  • 2
  • 5
7

You could use -- before the arguments for your mv command.

Levon
  • 11,174
  • 4
  • 45
  • 41
4

You could also use:

mv ./----index.html index.html
Mat
  • 51,578
  • 10
  • 158
  • 140
Jens Kilian
  • 141
  • 1