我想知道这两个命令之间的确切区别是:1. su 2. su -。有人能解释一下吗?
发布于 2016-05-26 17:32:27
手册页很好地描述了它,如下所示:
-, -l, --login
Start the shell as a login shell with an environment similar
to a real login:
o clears all the environment variables except TERM
o initializes the environment variables HOME, SHELL,
USER, LOGNAME, and PATH
o changes to the target user's home directory
o sets argv[0] of the shell to '-' in order to make
the shell a login shell我通常从我想要的环境来考虑这个问题,老实说,我总是默认使用su -。
https://unix.stackexchange.com/questions/285728
复制相似问题