最佳答案
来自man sudo
:
-s, --shell Run the shell specified by the SHELL environment variable if it is set or the shell specified by the invoking user's password database entry. If a command is specified, it is passed to the shell for execution via the shell's -c option. If no command is specified, an interactive shell is executed.
因此 -s
保留当前的 shell(在本例中为 bash),同时忽略它使用 root 用户的 shell (sh)。我自己,我更喜欢 sudo -Es
来保留我的 shell 和环境变量。
关于linux - macOS 中 sudo -s 和 sudo su 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43679864/