Study for the TestOut Linux Pro Exam with our engaging quiz. Prepare using our flashcards and comprehensive multiple choice questions, each with hints and explanations to help you succeed. Get ready for your Linux certification today!

Practice this question and more.


What command is used to change a user's account name in Linux?

  1. usermod -d

  2. usermod -l

  3. usermod -g

  4. usermod -c

The correct answer is: usermod -l

The command to change a user's account name in Linux is indeed `usermod -l`. The `-l` option specifically allows you to change the login name of an existing user account. When using this command, you specify the new username as an argument following the option, along with the current username of the account you want to modify. For example, if you wanted to change the username from "oldname" to "newname", the command would look like this: ``` usermod -l newname oldname ``` This change can be important for various administrative tasks, such as updating user names to reflect organizational changes or correcting misspellings. The other options serve different purposes: - The `-d` option is used to change a user's home directory, which does not affect the username itself. - The `-g` option is for changing a user's primary group, again unrelated to the account name. - The `-c` option allows the administrator to update or change the user's comment field (often containing the user's full name or description), which also does not affect the username. Understanding how these different options work enhances your capability to manage user accounts effectively in a Linux environment.