The command to switch from the current user to another user on Linux is su
.
By the way, this is an abbreviation for ** substitute user **. (Reference: su (Unix) --Wikipedia)
substitute means "use instead". The technique of changing only Pokemon is also called a substitute in English.
It's not an abbreviation for switch user or super user.
$ su [-] <user name>
The basic command usage is as above, and if you do not specify a user name, you will be super user (root).
The -
in the su
command means to inherit environment variables.
In other words, adding -
is the same as logging in as that user from the beginning.
$ su - anotherUser
--Inherit environment variables
--It will be the same situation as logging in as another User from the beginning$ su anotherUser
--Do not inherit environment variablesI wonder if such a simple post is good once in a while
Recommended Posts