Skip to content

Change shell

There are a few ways to determine the current shell

Terminal window
echo $0
ps -p $$
echo $SHELL

To change the current bash run these commands

Terminal window
export SHELL=/bin/bash
exec /bin/bash

to change the bash that opens on startup edit .profile and add those lines

To list available login shells :

Terminal window
cat /etc/shells

Example:

Terminal window
$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
  • echo $0
  • ps -p $$
  • echo $SHELL
  • export SHELL=/bin/bash
  • exec /bin/bash
  • cat /etc/shells