Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

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.

3 Answers 3

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.