我想知道这两个命令之间的确切区别是什么:1。苏 2. 苏 - 。谁能解释一下吗?
答案1
手册页对它进行了很好的描述,如下所示:
-, -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 -
默认设置。