nerdexam
Linux_Foundation

LFCS · 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 removes the user 'bob' from the system's user database and also deletes their home directory along with their mail spool.

Submitted by mateo_ar· Apr 18, 2026User and Group Management

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

(61 responses)
  • A
    89% (54)
  • C
    7% (4)
  • D
    3% (2)
  • E
    2% (1)

Why each option

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

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

The `userdel` command's primary function is to remove a specified user's account entry from the `/etc/passwd`, `/etc/shadow`, and other relevant system user databases.

BThe user bob's home directory is removed.Correct

The `--remove` (or `-r`) option with `userdel` explicitly instructs the command to delete the user's home directory and mail spool, ensuring associated files are also cleaned up from the system.

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

The `locate` database is not automatically updated by `userdel`; it requires a separate `updatedb` command, which is typically run periodically by cron.

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

`userdel --remove` only deletes the home directory and mail spool; it does not scan all mounted filesystems to remove all files owned by the user, which would be a highly destructive action.

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

`userdel` does not automatically delete a group even if the user being deleted was the last member; group deletion must be done explicitly with `groupdel`.

Concept tested: User deletion options (userdel)

Source: https://linux.die.net/man/8/userdel

Topics

#userdel command#user account removal#home directory management#command line options

Community Discussion

No community discussion yet for this question.

Full LFCS Practice