Which command and options are used to rename a Linux user, move their home directory, and update the comment?

Prepare for the TestOut Labs Test. Interactive quizzes and flashcards with insights and tips for a comprehensive review. Ace your exam!

Multiple Choice

Which command and options are used to rename a Linux user, move their home directory, and update the comment?

Explanation:
This uses the usermod command to change several attributes of an existing user in one go: the login name, the home directory, and the comment field. The -l option sets the new login name, so bcassini becomes bpalmer. The account to modify is the existing one listed after the options, bcassini. The -d option specifies the new home directory path as /home/bpalmer, and the -m option moves the current home directory contents into that new location so the user’s files follow the account name. The -c option updates the GECOS field, which stores the user’s full name or a comment, to "Brenda Palmer." Putting these together achieves renaming, relocating the home directory, and updating the display name in a single command. Other options either rename to a different name, use an invalid flag, or would lock the account, which doesn’t accomplish the requested tasks.

This uses the usermod command to change several attributes of an existing user in one go: the login name, the home directory, and the comment field. The -l option sets the new login name, so bcassini becomes bpalmer. The account to modify is the existing one listed after the options, bcassini. The -d option specifies the new home directory path as /home/bpalmer, and the -m option moves the current home directory contents into that new location so the user’s files follow the account name. The -c option updates the GECOS field, which stores the user’s full name or a comment, to "Brenda Palmer." Putting these together achieves renaming, relocating the home directory, and updating the display name in a single command. Other options either rename to a different name, use an invalid flag, or would lock the account, which doesn’t accomplish the requested tasks.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy