nerdexam
CompTIA

LX0-104 · Question #28

What is true regarding the command userdel --force --remove bob? (Choose TWO correct answers.)

The correct answer is A. The user bob is removed from the system's user database. B. The user bob's home directory is removed.. The command userdel --force --remove bob deletes the user account 'bob' from the system's database and removes their home directory along with its contents.

Administrative Tasks

Question

What is true regarding the command userdel --force --remove bob? (Choose TWO correct answers.)

Options

  • AThe user bob is removed from the system's user database.
  • BThe user bob's home directory is removed.
  • CThe locate database is updated to drop files owned by bob.
  • DAll files owned by bob are remove from all mounted filesystems.
  • EIn case bob was the last member of a group, that group is deleted.

How the community answered

(57 responses)
  • A
    91% (52)
  • C
    5% (3)
  • D
    2% (1)
  • E
    2% (1)

Why each option

The command `userdel --force --remove bob` deletes the user account 'bob' from the system's database and removes their home directory along with its contents.

AThe user bob is removed from the system's user database.Correct

The `userdel` command's primary function is to remove a user account entry from the system's user database files, such as /etc/passwd and /etc/shadow.

BThe user bob's home directory is removed.Correct

The `--remove` (or `-r`) option specifically instructs `userdel` to delete the user's home directory and mail spool, along with their contents, when removing the account.

CThe locate database is updated to drop files owned by bob.

The `locate` database is updated by the `updatedb` command, which is not automatically triggered by `userdel` and would not drop files specifically owned by the user.

DAll files owned by bob are remove from all mounted filesystems.

The `userdel --remove` command only targets the home directory and mail spool; it does not scan all mounted filesystems to remove every single file owned by the deleted user.

EIn case bob was the last member of a group, that group is deleted.

`userdel` does not automatically delete groups, even if the user being removed was the last member of a supplementary group.

Concept tested: userdel command options

Source: https://man7.org/linux/man-pages/man8/userdel.8.html

Topics

#userdel#user management#command options#home directory

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice