LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   useradd -c command (https://www.linuxquestions.org/questions/linux-newbie-8/useradd-c-command-794363/)

Terry56 03-10-2010 12:22 AM

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

paulsm4 03-10-2010 12:25 AM

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

Terry56 03-10-2010 12:35 AM

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

evo2 03-10-2010 12:56 AM

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.

Terry56 03-10-2010 01:23 AM

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

kingston 03-10-2010 01:31 AM

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.

evo2 03-10-2010 01:32 AM

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.

evo2 03-10-2010 01:33 AM

Quote:

Originally Posted by kingston (Post 3892515)
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.

freelinuxtutorials 03-10-2010 01:37 AM

sorry to say this, as other says, RTFM. use the man command or add --help after the command. it's explanatory.

Terry56 03-10-2010 01:39 AM

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

evo2 03-10-2010 01:45 AM

Quote:

Originally Posted by Terry56 (Post 3892527)
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.

Terry56 03-10-2010 02:33 AM

Hi:),
Thank you very much ;)from :newbie:


All times are GMT -5. The time now is 07:41 AM.