To know which shells are supported by the Linux system you can use cat /etc/shells command. A sample output of this is -
$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/bash
/bin/rbash
/bin/dash
/usr/bin/tmux
/usr/bin/screen
To know where a shell is located you can use which shell-name command. A sample output of this is -
$ which bash
/bin/bash
<aside>
💡 Giving the .sh extension to a shell is optional. The file can be executed as a shell script without the .sh extension. Using an extension will help editors to provide linting capabilites.
</aside>
<aside>
⚠️ Sometimes when you try to execute a shell script you might face an error saying Permission denied. When this happens, use the chmod command to give the execute permission to the user or to one who wants to execute the script.
</aside>
$ touch hello-world.sh
$ code hello-world.sh
#! /bin/bash
echo "Hello world"
$ ./hello-world.sh
Hello world
!# /bin/bash) known as hash bang helps the interpreter know which shell is being used.