LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-31-2005, 07:58 AM   #1
neo_in_matrix
Member
 
Registered: Sep 2003
Posts: 52

Rep: Reputation: 15
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?
 
Old 03-31-2005, 08:00 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
You can use "groupadd".
 
Old 03-31-2005, 08:26 AM   #3
neo_in_matrix
Member
 
Registered: Sep 2003
Posts: 52

Original Poster
Rep: Reputation: 15
Is there a shell command to do the same task?
 
Old 03-31-2005, 08:33 AM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
That is a shell command.
 
Old 03-31-2005, 08:06 PM   #5
neo_in_matrix
Member
 
Registered: Sep 2003
Posts: 52

Original Poster
Rep: Reputation: 15
I see. I do not have /usr/sbin in my path. Is that normal?
 
Old 03-31-2005, 08:28 PM   #6
cdavidson
Member
 
Registered: Jan 2004
Location: Mississippi
Distribution: Gentoo 2006.1, openSuSe 10.2
Posts: 43

Rep: Reputation: 15
/usr/sbin is normally only in root's path. be sure you are getting to root using su - and then run groupadd as root.
 
Old 03-31-2005, 08:58 PM   #7
neo_in_matrix
Member
 
Registered: Sep 2003
Posts: 52

Original Poster
Rep: Reputation: 15
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.
 
Old 04-01-2005, 07:17 AM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Make sure you use "su -" and not just "su". This will load /root/.bash_profile etc.
 
Old 04-01-2005, 08:07 AM   #9
neo_in_matrix
Member
 
Registered: Sep 2003
Posts: 52

Original Poster
Rep: Reputation: 15
Red face

How did you know that?
 
Old 04-01-2005, 08:10 AM   #10
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
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.
 
Old 04-01-2005, 08:47 AM   #11
neo_in_matrix
Member
 
Registered: Sep 2003
Posts: 52

Original Poster
Rep: Reputation: 15
Great. I never noticed that small hyphen. Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can i create a user group at this site? asahlot LQ Suggestions & Feedback 1 10-13-2005 03:08 PM
why can't i create new group luxpops Programming 10 09-11-2004 04:15 AM
how to change/create group password feetyouwell Linux - Software 3 09-06-2004 09:38 PM
Every file I create has a group different than root. How do I find out where this is rfelter Linux - Software 4 04-16-2004 09:28 AM
create user/group in cmd line rgiggs Mandriva 3 04-12-2004 09:46 PM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration