# How do you use pw to add a user to operator group?



## neilms (Feb 10, 2013)

The FreeBSD handbook is not clear about this. pw is a command that has so many options that it is simply confusing for a normal user. I want to do something that would be easy under gnome desktop:

add _someuser_ to the group operator.

That is all.
How is this done with pw? IMHO pw is an example of a command being made into something so overly complex that it is incomprehensible. If I had an alternative I would not touch it.


----------



## fonz (Feb 10, 2013)

neilms said:
			
		

> add _someuser_ to the group operator.


Why don't you just edit /etc/group directly?

P.S. I think the command you're looking for is `# pw groupmod [i]operator[/i] -m [i]someuser[/i]`


----------



## fonz (Feb 10, 2013)

neilms said:
			
		

> IMHO pw is an example of a command being made into something so overly complex that it is incomprehensible. If I had an alternative I would not touch it.


I rarely ever touch pw(8). /etc/group can be edited directly (by root, obviously) and for /etc/(master.)passwd there's vipw(8).


----------



## jwele (Feb 10, 2013)

```
# pw groupmod operator -m username
```


----------



## swa (Feb 10, 2013)

Hi, 

I always use the *help* switch for things like this, because I am too lazy to remember those options 

`# pw group mod help`


```
usage: pw groupmod [group|gid] [switches]
	-V etcdir      alternate /etc location
	-C config      configuration file
	-q             quiet operation
	-F             force add if not exists
	-n name        group name
	-g gid         group id
	-M usr1,usr2   replaces users as group members
	-m usr1,usr2   add users as group members
	-d usr1,usr2   delete users as group members
	-l name        new group name
	-Y             update NIS maps
	-N             no update
```

As mentioned above, you need -m


----------

