If I enter whoami in Terminal.app my id is shown as Abhi.Sri

Now if I do chown -R Abhi.Sri /usr/local it says the user Abhi.Sri is invalid.

  • 1
    Please copy/paste the full output of both whoami and chown, details may matter here. – nohillside Dec 5 '15 at 8:00
  • 1
    As I've just verified, usernames with . are not a problem for chown, so the problem is definitively something else. But we need some more details about your setup to find out where the issue is. – nohillside Dec 5 '15 at 8:59

I think your short username is malformed. I recommend to rename it to lower case characters (and no special characters except the underscore).

Additionally you would have to use a sudoers account (e.g. an admin account) and prepend sudo to change ownership of /usr/local since /usr/local is owned by root:wheel. Changing the ownership of /usr/local and subsequent items is non-standard and not recommended.

  • OS X happily lets you create usernames with dots and in mixed caps, so this is not the issue here. – nohillside Dec 5 '15 at 9:00

The terminal might be interpreting the dot ('.') as a wildcard character.

I'm not at my Mac, so I can't test this, but try escaping the '.' with a backslash:

chown -R Abhi\.Sri /usr/local

  • Can someone explain why this may have been voted down? Obviously I'm new here, and I'd like to know what makes a good answer. I've taken the "get started" tour and checked the help system specifically for what makes a "good" answer. – bpatzke Dec 8 '15 at 17:02

Not the answer you're looking for? Browse other questions tagged .