Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the default shell

Tags:

shell

macos

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 having a terminal open and running a command to know which shell we’re in. I mean like in the example above, if I’m in a terminal with /bin/bash open, what should I run to get /usr/local/bin/zsh if it’s the current default shell?

like image 535
user137369 Avatar asked May 04 '13 14:05

user137369


People also ask

What is the default shell?

In most Linux systems, the default shell is bash but we can change that to any other shell-like zsh, fish, sh, and any other.

How do I set bash as default shell?

Hold the Ctrl key, click your user account's name in the left pane, and select “Advanced Options.” Click the “Login Shell” dropdown box and select “/bin/bash” to use Bash as your default shell or “/bin/zsh” to use Zsh as your default shell. Click “OK” to save your changes.


1 Answers

You can use the following command:

echo $SHELL 
like image 108
Bill Avatar answered Sep 21 '22 23:09

Bill