How do you switch between users in the terminal?

Prepare for the Linux Professional Institute Certification Level 1. Use flashcards and multiple choice questions, complete with hints and explanations. Enhance your understanding and get ready to ace the exam!

Switching between users in the terminal can be accomplished using the command 'su - username', where 'su' stands for "substitute user." This command allows you to switch to another user account within the terminal session. The hyphen after 'su' is important because it provides an environment similar to what the user would get if they logged in directly. This means that it will switch to the user's home directory and load their environment variables, such as path settings and shell configuration.

The other choices do not function for switching users as effectively. For instance, 'login username' is typically used to initiate a new session rather than change the current user in an existing terminal session. The 'chown username' command is used for changing the ownership of files or directories and does not relate to user switching. Lastly, 'switch username' is not a valid command in Linux for changing users. Therefore, using 'su - username' is the appropriate choice for the task of switching users in the terminal.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy