Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I'm a newbie to Linux so please be nice. :) I'm studying for the Network+ and am currently learning about installing Linux on a server. Anyway, when it comes to adding a new user, the book gives the example of:useradd -m -g users -G teachers thomas
Well, I understand all of it except the book doesn't say anything about the -m switch and I was just wondering why it's there? Many thanks!

From the useradd man page ("man useradd"):
-m, --create-home
The user's home directory will be created if it does not exist. The files contained in SKEL_DIR will be copied to the home directory if the -k option is used, otherwise the files contained in /etc/skel will be used instead. Any directories contained in SKEL_DIR or /etc/skel will be created in the user's home directory as well. The -k option is only valid in conjunction with the -m option. The default is to not create the directory and to not copy any files.

man useradd to find out all the options:
-m The user's home directory will be created if it does not exist. The files contained in skeleton_dir will be copied to the home directory if the -k option is used, otherwise the files contained in /etc/skel will be used instead. Any directories contained in skeleton_dir or /etc/skel will be created in the user's home directory as well. The -k option is only valid in conjunction with the -m option. The default is to not create the directory and to not copy any files.

![]() |
linux - broadcom wlan - h...
|
Scroll wheel won't work
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |