Courseiva
Essential CommandshardMultiple ChoiceObjective-mapped

LFCS Essential Commands Practice Question

A systems administrator needs to add a new user 'jdoe' with a home directory in /export/home, a UID of 1500, and an expiry date of 2025-12-31. Which command should they use?

⚠ Common exam trap

Many candidates confuse the `-c` (comment) option with `-e` (expiry) and assuming `-b` (base directory) works the same as `-d` (explicit home directory), leading candidates to pick options that set the wrong field or fail to place the home directory in the specified path.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

useradd -u 1500 -d /export/home/jdoe -e 2025-12-31 jdoe

The `useradd` command with `-u 1500` sets the UID, `-d /export/home/jdoe` explicitly specifies the home directory path (without creating it unless `-m` is also used), and `-e 2025-12-31` sets the account expiry date in YYYY-MM-DD format. This matches all requirements: UID 1500, home directory at /export/home/jdoe, and expiry on 2025-12-31.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • useradd -u 1500 -d /export/home/jdoe -e 2025-12-31 jdoe

    Why this is correct

    Correct: sets UID, home directory, and expiry.

  • useradd -u 1500 -d /export/home/jdoe -c 2025-12-31 jdoe

    Why it's wrong here

    -c is for comment, not expiry.

  • useradd -u 1500 -m -e 2025-12-31 jdoe

    Why it's wrong here

    Home directory created in default /home/jdoe, not /export/home.

  • useradd -u 1500 -b /export/home -e 2025-12-31 jdoe

    Why it's wrong here

    -b sets base directory, home would be /export/home/jdoe but -b is not standard; usually -d is used.

About these practice questions

One of 507 original LFCS practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LFCS practice question is part of Courseiva's free Linux Foundation certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LFCS exam.