Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I happen to know there is a slight difference between adduser and useradd.
(i.e., adduser has additional features to useradd, such as creating a home directory.)

Then what is the relation between addgroup and groupadd?
Is there a preferred way to create a group?

share|improve this question
    
I strongly dislike this particular namescheme. Can never remember which is the more primitive of the utilities. –  dubiousjim Nov 13 '12 at 14:03
add comment

1 Answer

up vote 6 down vote accepted

On most distribution adduser and addgroup are interactive 'convenience' wrappers around the commands useradd and groupadd.

You can find addgroup using the command which addgroup, on my machine (Ubuntu 11.04) this lives in /usr/sbin/addgroup.

On my box addgroup is a perl script that prompts for various options (interactively) before invoking the groupadd command.

groupadd is usually preferable for scripting (say, if you wan't to create users in batch), whereas addgroup is more user friendly (especially if you are unfamiliar with all the options and flags).

Of course addgroup also takes many options via the command when you invoke it, but it is primarily intended as an interactive script.

Interestingly on my box addgroup is a symlink to adduser, the script checks the name it was invoked under and performs different actions accordingly.

share|improve this answer
    
thanks a lot! :) –  e9t Nov 14 '12 at 8:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.