Which command allows a user to exit from the 'su' session?

Prepare for the LPI Linux Essentials Exam. Study with flashcards and multiple choice questions, each with hints and explanations. Get exam-ready!

The command that allows a user to exit from the 'su' session is 'exit'. When a user switches to another user account using 'su' (substitute user), they enter a new shell session with the privileges of that account. To return to the previous account, the user can simply type 'exit', which terminates the current shell session and returns them to the shell prompt of the original user.

Using 'exit' is a standard command across Unix-like operating systems for terminating a shell session, making it a consistent choice for this operation. Other commands may have different contexts but do not serve this specific function within the 'su' session. For instance, 'logout' is often used to end a login shell, but it may not work in all situations where 'su' has been invoked, particularly if the shell session started by 'su' is a non-login shell. Similarly, 'quit' and 'close' are not valid commands recognized by the shell for this purpose. Thus, 'exit' is the universally applicable command for ending the 'su' session correctly.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy