Find out where bash is installed
May 7, 2021 ‐ 1 min read
To find out where
bash, or any other shell program, is installed on your system you may use the
which locates commands in your PATH.
$ which bash /usr/bin/bash
PATH is an environment variable in your system that defines a list of directories in which your shell looks for executable commands when you enter them. As you see from the output of our
which command, an occurrence of
bash is found in the directory
/usr/bin. In my case this is where the program
bash is located.
Where command in zsh
If you are using the zsh shell instead of bash you have another option besides the
which command. The zsh shell comes with a
where shell builtin that you can use as alternative to
$ where bash /usr/bin/bash /bin/bash