Cómo comprobar cuál es el ‘shell de inicio de sesión por defecto’ en las preferencias de la terminal de mi Mac

Mac OS ha cambiado recientemente el shell por defecto utilizado en la terminal, lo que puede ser confuso. Debido a las restricciones de la licencia (por lo que tengo entendido) la versión de bash que viene con el Mac es bastante antigua (es decir, la versión 3.2.57 frente a la 5.0 que es la actual en el momento de escribir esto). If you are interested in changing back to bash, you may want to use home-brew (a package manager) to install a more recent version of bash.

The simplest way to know what shell your user account is configured to use, is to type the following command into the terminal:

  1. echo  

The response will give you the path to the currently set shell. If you’d like to know the version number, you can type the following command into the terminal:

  1. —version 

If you’d like to change the default shell for your user id, use the chsh command as follows:

  1. chsh -s /path/to/shell 

Note that this will only work for a shell listed in the /etc/shells file. If you wish to set a default shell to one that is not in that list (for example, /usr/local/bin/bash if you’ve installed bash from brew), you must add a line in the file /etc/shells file to authorize that as a default shell.

  1. sudo echo “/usr/local/bin/bash” >> /etc/shells 

If you prefer, you can change the shell using the Mac UI. Para ello, vaya a Preferencias del Sistema | Usuarios y Grupos, luego haga clic con el botón derecho sobre su nombre y elija opciones avanzadas. Allí deberías ver un menú desplegable con una lista de los shells disponibles en /etc/shells. Elige el que quieras.