2

The command useradd new will create the /home/new directory.

Is there a way to create the /home/new and /home/new/check directories when useradd new is executed?

I don't want to write two commands for the job every time I create a new user.

useradd new
mkdir /home/new/check
apaderno
  • 825
scrapy
  • 333
  • In additon to the answer below about putting files/directories in /etc/skel consider using adduser instead of useradd - unless you are creating accounts with a script... – ivanivan Oct 30 '17 at 11:59

1 Answers1

10

The template used when creating a new home directory is in /etc/skel. Simply create the directory there and all new users will have it.