Linux middle su sum su-classification

The command to switch users in Linux is su or su -. The biggest essential difference between the su command and the su-command is that the former only switches the root identity, but the Shell environment is still the shell of the ordinary user; while the latter even switches the user and the shell environment into the root identity. Only when the Shell environment is switched, the PATH environment variable error will not occur. After su was switched to the root user, I clicked on pwd and found that the working directory was still the working directory of ordinary users; and after switching with the su-command, the working directory became the working directory of root. Therefore, to switch from the current user to other users, the su-command should be used.

Guess you like

Origin blog.csdn.net/weixin_42692164/article/details/113242697