The content originates from the people's post and Telecommunications press "Linux command Application big dictionary"
tell 729 commands, 1935 examples
Learn about the Linux system's reference books, desk book, encountered the command or command not understand the options can be found
Strive to publish content every day
SU command
You can use the su command to switch to another user account to log in. If the SU command does not have any options, the default is to switch to the root user without changing the Shell environment.
Command syntax:
su [ options ] [ user ]
The meanings of the options in the command are as follows is shown.
table su command options meaning
Options |
Meaning |
- |
Change Login Shell |
-L |
log in and change users Shell Environment |
-F |
suitable for csh and Tsch, so that the Shell does not have to read the boot file |
-M |
Do not set environment variables |
-S <shell type > |
specifies what to do. Shell Type |
-C < commands > |
Executes a command, and then exits the user environment in which it is located |
Example : Switch User root to user it for login and even Shell environment.
[Email protected] ~]# su-it
Switch from user root to normal user it does not need to enter the user's password
[Email protected] ~]$ pwd
/home/it
the Shell environment has switched, so the current working directory path is /home/it
Example : Switch User root to user it to log in, theShell environment does not need to switch.
[email protected] ~]# SU it
[Email protected] root]$ pwd
/root
the Shell environment does not switch, so the current working directory path is /root
Example : Switch from user it to user root login system, and even Shell environment switch.
[email protected] ~]$ Su-
Password: // Enter the user root password here
[Email protected] ~]#
// switch from normal user to Root users need to enter Root User's password
Example : User It uses the Su method to execute the "ls/root" command with the root user .
[Email protected] ~]$ su-root-c "Ls/root"
Password: // Enter the user root password here
Anaconda-ks.cfg install.log install.log.syslog public template video picture Document
This article from "airfish2000" blog, declined reprint!
SU Command--linux command application large dictionary 729 interpretation of commands