How to get default shell

前端 未结 5 789
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-08 02:56

We can run something like chsh -s /usr/local/bin/zsh to set a new default shell. Is there a command we can run to know what that shell is?

I don’t mean

5条回答
  •  忘掉有多难
    2020-12-08 03:16

    In OS X, using the command env | grep -i 'SHELL' produces an output such as: SHELL=/bin/sh (as root, however regular users tend to have /bin/bash as default shell) with a little parsing, the path the shell (and thus the shell itself) could be easily identified and extracted from there..

提交回复
热议问题