2

How can I check all the different shells that I can use in OSX Terminal application?

The default one is bash, and I know zsh because I tried and it worked. I wonder how can I check if there are any more than this two.

davigueras
  • 135
  • 1
  • 2
  • 8
  • I'm voting to close this question as off-topic because it is not about programming; it may be more suitable for apple.stackexchange.com – chepner May 24 '16 at 18:21

2 Answers2

9

The easy way is go to /etc and check the shells file. The content is the list of shells available in Mac OSX.

The included by default are:

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh

Alternatively, you can check their binaries by going to /bin and recognising them visually. Naturally, you have to know them in order to recognise them.

davigueras
  • 135
  • 1
  • 2
  • 8
  • 3
    Actually, `/etc/shells` contains all shells that are *valid*, but not all that are *available* – this is an important distinction. If a shell is listed in `/etc/shells`, it means that a user may choose it, but not necessarily, that it is installed and the user can choose it. So one should always check whether the binary listed in `/etc/shells` actually exists (e.g., with `[ -x $shell_bin ]`) – Technaton May 24 '16 at 18:20
  • You can also use `chsh -l` to see the list. – Andreas Louv May 24 '16 at 18:30
  • 1
    @andlrc not on Mac OS X, where `-l` means location – Henno Brandsma May 24 '16 at 18:34
  • @HennoBrandsma Thanks for clarifying :-) – Andreas Louv May 24 '16 at 18:35
6

In MacOS the following command will list the available shells on your system

$ ls -l /bin/*sh
-r-xr-xr-x  1 root  wheel   618448 Nov 19 00:26 /bin/bash
-rwxr-xr-x  1 root  wheel   380016 Feb  7 16:11 /bin/csh
-r-xr-xr-x  1 root  wheel  1287040 Sep 21 00:35 /bin/ksh
-r-xr-xr-x  1 root  wheel   618512 Nov 19 00:26 /bin/sh
-rwxr-xr-x  1 root  wheel   380016 Feb  7 16:11 /bin/tcsh
-rwxr-xr-x  1 root  wheel   610288 Sep 21 00:35 /bin/zsh
wgibbons
  • 61
  • 1
  • 2