16
ubuntu64@ubuntu:/$ sudo chown –R hduser:hadoop mongodbdata
chown: invalid user: ‘–R'

When I try to change the ownership of the file, I am just getting invalid user: '-R' error.

Eliah Kagan
  • 119,640
Christopher Gaspar
  • 165
  • 1
  • 2
  • 6

1 Answers1

37

You must have copied the command from a webpage that uses strange formatting. That's not a normal minus, try this instead:

sudo chown -R hduser:hadoop mongodbdata

Specifically, the one I copied from your question is an en dash (U+2013):

$ unicode -s  –
U+2013 EN DASH
UTF-8: e2 80 93  UTF-16BE: 2013  Decimal: –
–
Category: Pd (Punctuation, Dash)
Bidi: ON (Other Neutrals)
terdon
  • 104,119