Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

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


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?


share|improve this question

migrated from stackoverflow.com May 21 '12 at 12:42

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Michael Mrozek May 21 '12 at 17:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 8 down vote accepted
mv -- ----index.html index.html
grep hello -- *
share|improve this answer

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

share|improve this answer

You could also use:

mv ./----index.html index.html
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.