Home > Article > Operation and Maintenance > What is the function of su command in linux system?
What is the function of su command in linux system?
1. Command function
linux system The function of the su command is to change the identity of other users, except the super user, who needs to type in the user's password.
2. Usage
su [-fmp] [-c command] [-s shell] [--help] [--version] [-] [USER [ARG]]
3. Parameter description
f , –fast: There is no need to read startup files (such as csh.cshrc, etc.), only used for csh or tcsh Shell.
l , –login: After adding this parameter, it will be like logging in again. Most environment variables (such as HOME, SHELL and USER, etc.) are based on the user ( USER) as the main one, and the working directory will also change. If USER is not specified, the default is root.
m, -p, –preserve-environment: Do not change environment variables when executing su.
c command: Change the account to USER, execute the command (command) and then change back to the original user.
help Display description file
version Display version information
USER: Use to be changed User account,
ARG: Pass in new Shell parameters.
The above is the detailed content of What is the function of su command in linux system?. For more information, please follow other related articles on the PHP Chinese website!