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,820
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,404
  • 1
    In this context, it's probably more appropriate to call it a hyphen than a minus. – Alex Apr 04 '15 at 15:39
  • 1
    @Alex I beg to differ. Personally, I prefer minus in this context and hyphen when talking about text. I am not alone, that is the standard old school UNIX way. Some people do say dash but I've never heard it called a hyphen in this context. – terdon Apr 08 '15 at 21:26
  • @terdon Huh. That seems really odd to me, but tradition does count for something. I've only ever used the word minus in math. – Alex Apr 10 '15 at 10:34
  • 1
    @Alex both minus and dash are used in this context but certainly not hyphen which is a different thing altogether. – terdon Apr 10 '15 at 12:03