Question 280 of 513
Essential CommandshardMultiple ChoiceObjective-mapped

Quick Answer

The correct command is useradd -u 1500 -d /export/home/jdoe -e 2025-12-31 jdoe, as it precisely meets the requirement to create user jdoe with a specific UID, home directory, and expiry date. The -u flag assigns the UID 1500, the -d flag sets the home directory path to /export/home/jdoe (though the directory itself is not created unless -m is added), and the -e flag defines the account expiry in YYYY-MM-DD format, which the system interprets as 2025-12-31. On the LFCS exam, this tests your ability to recall the exact useradd syntax for account customization, a common scenario in user management tasks. A frequent trap is confusing -d with -m: -d only specifies the path, while -m actually creates the home directory. To remember the flags, think of the mnemonic “U-D-E” for UID, Directory, and Expiry, matching the order they appear in the command.

LFCS Essential Commands Practice Question

This LFCS practice question tests your understanding of essential commands. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

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?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "which command"

    Why it matters: Tests specific CLI syntax. Recall the exact command and its required context — near-synonyms and partial matches are common distractors.

Question 1hardmultiple choice
Full question →

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

Option A is correct because 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.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

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.

    Clue confirmation

    The clue word "which command" in the question point toward this answer.

    Related concept

    Read the scenario before looking for a memorised answer.

  • 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.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is confusing 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.

Detailed technical explanation

How to think about this question

The `useradd` command reads `/etc/default/useradd` and `/etc/login.defs` for defaults like UID_MIN, UID_MAX, and home directory base. The `-e` option sets the `EXPIRE` field in `/etc/shadow` as a Unix timestamp (days since 1970-01-01), which the system checks at login via `pam_unix.so` or `pam_lastlog.so`. In real-world scenarios, using `-d` without `-m` is common when home directories are on NFS or separate partitions and are pre-created by another process.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A small business has 20 workstations on the 192.168.1.0/24 network and one public IP from its ISP. The router uses PAT (NAT overload) so all 20 devices share one public address using different source ports. NAT questions test whether you understand the four address terms and which direction each translation applies.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related LFCS practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free LFCS practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this LFCS question test?

Essential Commands — This question tests Essential Commands — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: useradd -u 1500 -d /export/home/jdoe -e 2025-12-31 jdoe — Option A is correct because 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.

What should I do if I get this LFCS question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Are there clue words in this question I should notice?

Yes — watch for: "which command". Tests specific CLI syntax. Recall the exact command and its required context — near-synonyms and partial matches are common distractors.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.