LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to create a new group? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-create-a-new-group-308185/)

neo_in_matrix 03-31-2005 07:58 AM

How to create a new group?
 
I want to know how to create a new group under the shell by command and in code using system calls. Can anyone help?

david_ross 03-31-2005 08:00 AM

You can use "groupadd".

neo_in_matrix 03-31-2005 08:26 AM

Is there a shell command to do the same task?

david_ross 03-31-2005 08:33 AM

That is a shell command.

neo_in_matrix 03-31-2005 08:06 PM

I see. I do not have /usr/sbin in my path. Is that normal?

cdavidson 03-31-2005 08:28 PM

/usr/sbin is normally only in root's path. be sure you are getting to root using su - and then run groupadd as root.

neo_in_matrix 03-31-2005 08:58 PM

That's strange. If I su into root using a shell when in a normal user account, /usr/sbin is not in path. It seems /etc/profile does not get parsed in this way. If I logon using the graphical UI, then I have /usr/sbin in my path.

david_ross 04-01-2005 07:17 AM

Make sure you use "su -" and not just "su". This will load /root/.bash_profile etc.

neo_in_matrix 04-01-2005 08:07 AM

How did you know that?

david_ross 04-01-2005 08:10 AM

man su
Code:

DESCRIPTION
      su  is used to become another user during a login session.
      Invoked without a username, su defaults  to  becoming  the
      super user. The optional argument - may be used to provide
      an environment similiar to what the user would expect  had
      the user logged in directly.


neo_in_matrix 04-01-2005 08:47 AM

Great. I never noticed that small hyphen. Thanks.


All times are GMT -5. The time now is 12:55 PM.