LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-10-2010, 01:22 AM   #1
Terry56
Member
 
Registered: Oct 2009
Posts: 49

Rep: Reputation: 15
Question useradd -c command


Hi to all,
Hope you all will be fine. I want to ask what's this command mean

Quote:
useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk
what is "Asterisk PBX represent and what is last asterisk represent. If i interpret it i think it means

Quote:
add user then what is -c option and Asterisk PBX? i don't know. -d represent directory /var/lib/asterisk but then what this last asterisk represent(i.e., after space)
And also please tell me what it's impact in the current directory.Means if i am executing it in the directory say
[root@localhost asterisk-1.6.2.4]# useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk

Then what it means

Thanks
 
Old 03-10-2010, 01:25 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Look here (or do a "man useradd"):
http://linux.die.net/man/8/useradd

"-c" is usually used to specify a user's full name (as in useradd -c "Kris Kringle" santaclause)

The user created by this command is the final argument (here, user is "asterisk")

'Hope that helps .. PSM

Last edited by paulsm4; 03-10-2010 at 01:27 AM.
 
Old 03-10-2010, 01:35 AM   #3
Terry56
Member
 
Registered: Oct 2009
Posts: 49

Original Poster
Rep: Reputation: 15
Hi,
Thanks for your quick reply. Does it mean that add new user named "asterisk" in /var/lib/asterisk directory whose full name or login is "Asterisk PBX"

Thanks
 
Old 03-10-2010, 01:56 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Very close.

The login is the same as the username: "asterisk".

The user is not "in /var/lib/asterisk", /var/lib/asterisk is the users home directory.

The full name is just a description: it is not the login name.

Cheers,

Evo2.
 
Old 03-10-2010, 02:23 AM   #5
Terry56
Member
 
Registered: Oct 2009
Posts: 49

Original Poster
Rep: Reputation: 15
Hi,
Thanks. But please can you tell me what is mean by /var/lib/asterisk is the users home directory. Do users create somewhere else also other than home directory?

Thanks
 
Old 03-10-2010, 02:31 AM   #6
kingston
Member
 
Registered: Mar 2008
Location: Bengaluru, India
Distribution: RHEL 5.5, Solaris 5.10
Posts: 215
Blog Entries: 1

Rep: Reputation: 21
yes...by default users will be created in the /home directory. (If you didnt edit the file /etc/default/useradd and the uid and gid is set through /etc/login.defs file). But you can specify the path of the user's home directory while creating the user with the "d" option.

Last edited by kingston; 03-10-2010 at 03:36 AM.
 
Old 03-10-2010, 02:32 AM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Quote:
But please can you tell me what is mean by /var/lib/asterisk is the users home directory.
The home directory for a normal user is typically /home/username. This is the location where by default they store their files and is the location they will be placed in when starting a login shell.

Quote:
Do users create somewhere else also other than home directory?
I don't understand this sentence. Do users create what? The user doesn't create their home directory: the admin or useradd (or similar) program should do that when the user account is created.

Evo2.
 
Old 03-10-2010, 02:33 AM   #8
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Quote:
Originally Posted by kingston View Post
yes...by default users will be created in the /home directory.
What do you mean by this? Users are created by putting entries in /etc/passwd: so if anything that is "where" they are created.

Evo2.
 
Old 03-10-2010, 02:37 AM   #9
freelinuxtutorials
Member
 
Registered: Oct 2009
Posts: 70

Rep: Reputation: 21
sorry to say this, as other says, RTFM. use the man command or add --help after the command. it's explanatory.
 
Old 03-10-2010, 02:39 AM   #10
Terry56
Member
 
Registered: Oct 2009
Posts: 49

Original Poster
Rep: Reputation: 15
Hi ,
Ok ok by providing -d /var/lib/asterisk we mean that this is user's home directory now. If we didn't use -d option then /home/user will be the home directory. Am i right?

Thanks
 
Old 03-10-2010, 02:45 AM   #11
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Quote:
Originally Posted by Terry56 View Post
Hi ,
Ok ok by providing -d /var/lib/asterisk we mean that this is user's home directory now. If we didn't use -d option then /home/user will be the home directory. Am i right?
Yes, unless some location (other than /home) is specified in /etc/default/useradd or is specified with the -b flag.

Anyway as pointed out, all this information is in the man page.

Cheers,

Evo2.
 
Old 03-10-2010, 03:33 AM   #12
Terry56
Member
 
Registered: Oct 2009
Posts: 49

Original Poster
Rep: Reputation: 15
Hi,
Thank you very much from
 
  


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
[SOLVED] useradd command a7mlinux Linux - General 8 08-12-2009 02:20 PM
useradd command sophisticate Linux - Newbie 2 01-06-2008 12:49 PM
useradd command Linuxien Linux - General 2 11-14-2006 08:32 AM
useradd command Wolvastur Linux - Newbie 9 01-25-2005 11:01 AM
useradd command allancondino Linux - General 5 04-27-2002 01:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:25 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