Can useradd create directory recursively?
Issue
I was going to add user and create directory using useradd command, but an error occured with the following message:
# useradd -m -d /home/user/testuser1 testuser1
useradd: cannot create directory /home/user/testuser1
"/home/user" was not created, and I expected that "/home/user/ and "/home/user/testuser1" are created at rhe same time.
Environment
- Red Hat Enterprise Linux 5
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
