1

I'm trying to do:

chown :Users filename

And I get

chown: invalid grup: «:Users»

What am I doing wrong? Is there something I don't understand?

fedorqui
  • 252,262
  • 96
  • 511
  • 570
John
  • 11
  • 3

2 Answers2

2

You are trying to keep the same user and change the group, saying chown :group instead of chown user:group.

The syntax is wrong, so you can either use chown indicating the current user or directly use chgrp instead:

chgrp Users filename
fedorqui
  • 252,262
  • 96
  • 511
  • 570
  • Does the group `Users` even exist? You can check it in `/etc/group` by saying for example `awk -F: '$1=="Users"' /etc/group`. – fedorqui Feb 11 '15 at 15:17
  • @ fedorqui It says "no such file or directory /etc/group". – John Feb 11 '15 at 15:27
  • Then the problem is in the group name itself. You may be able to see all the groups by saying `groups`, as indicated in [Is there a command to list all Unix group names?](http://stackoverflow.com/a/14060177/1983854) – fedorqui Feb 11 '15 at 15:52
1

Try:

chgrp Users /path/to/filename

PS: keep in mind that "Users" is different of "users".