One of them is probably a link to the other...
Traditionally, shells (like bash
, csh
and zsh
) are located in /bin - because a shell is needed even in single user mode or other times when /usr may be unmounted (/usr is often on a separate partition and may even be mounted through the network - thus not readily available in singe user mode).
On the other hand, additional shells (than the default one/ones) aren't strictly needed in single user mode (unless root happens to use one of them), so it's natural to put such shells it in /usr/bin instead of /bin.
When you do place it in /usr/bin though, it's common to provide a symbolic link to it from /bin, as users tends to expect their shells to be directly under /bin (not that a link would help if /usr wasn't mounted).
So when compiling the list of available shells to choose from (/etc/shells), both the real executable and the link have been listed. You can use ls -l
to check what is the link and what is the executable.
+++
Both /bin/zsh
and /usr/bin/zsh
are explicitly added together (same if-fi block) in the postinst
(post-install) script for the zsh-package, using the add-shell
command:
From zsh_5.1.1-1ubuntu2_amd64.deb:/DEBIAN/postinst
#!/bin/sh
...
case "$1" in
(configure)
# if test -z "$2"; then
add-shell /bin/zsh
add-shell /usr/bin/zsh
# fi
...