5

I have created a group in Ubuntu terminal called terminal using groupadd terminal command and when I list out the groups using groups command it will not show the newly created group name in the output but if I add the same group again it gives me

groupadd: group 'terminal' already exists

error message but the group name exists in /etc/group file. Why I am not able to see the newly added group while running group command?

4
  • muru: can you please check that question problem and this question
    – Suresh
    Sep 4, 2015 at 10:43
  • 1
    I did. Can you do that too?
    – muru
    Sep 4, 2015 at 10:44
  • so you are telling usermod will solve my problem ? is it ?
    – Suresh
    Sep 4, 2015 at 10:49
  • I prefer adduser (second answer) or gpasswd, but yes.
    – muru
    Sep 4, 2015 at 10:50

1 Answer 1

14

groups shows you your groups and not all. You could list all groups for example like that:

getent group

If you added yourself to the group, you'll need to logout and login for the change to take effect.

2
  • Jakob: if groups shows my groups then the added group generally goes under whom ? If I wanted to added group under me then how do I do that ?
    – Suresh
    Sep 4, 2015 at 10:45
  • 2
    @Suresh it doesn't go "under" anybody, it just is. A group without any members. If you want to add your user to a group, see the question I linked to.
    – muru
    Sep 4, 2015 at 10:49

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