Home > Article > Operation and Maintenance > How to exit as a linux user (command)
There are three ways for Linux users to log out:
1. Enter exit at the shell prompt and press Enter to confirm
2. Enter logout at the shell prompt and press Enter to confirm
3. Press the shortcut key crtl d (this method has the same effect as logout)
One of the common Linux commands ——Exit and switch users. The exit and su
exit commands are the same as exiting the shell and return a given value. In the shell script, the current script execution can be terminated. Executing exit can cause the shell to exit with the specified status value.
If the status value parameter is not set, the shell exits with the default value. The status value 0 represents successful execution, and other values represent execution failure.
su command is used to switch the current user identity to another user identity. When changing, you must enter the user account and password to be changed.
Related recommendations: linux tutorial
The above is the detailed content of How to exit as a linux user (command). For more information, please follow other related articles on the PHP Chinese website!