Is there a way to determine what shells are available on a Linux box other than trying out /bin/shellname ?
Even a workaround would do :)
asked 03 May '10, 08:16
Have you a look in /etc/shells?
Thinking about this further you could also make use of "whatis" command for any shells that are not listed in "/etc/shells".
This will list any shells in '/bin' that have a description that contains the word "shell". It may also be worth doing this in other directories such as /usr/bin, /sbin. This may produce the odd false positive but should give you something to work with.
which and whereis, along with locate. on a newly installed machine run
when you first install the OS so you can use locate, which likes specific syntax,but shows everything matching.
And on Slackware you can grep /var/log/packages for a match.
For determining, say, whether you had ruby installed, you would type:
And if ruby is installed, you should get back:
...others are python, bash, tclsh, tcsh, zsh, ksh, tksh, sh (usuallaly just a symlink to /usr/bin/bash, but will actually point to /bin/tcsh if you choose the C shell as your particular user's default.
to quickly determine the default shell for any particular user simply grep /etc/password for their username and examine the designated shell (or lack thereof) there.
I hope that helps!
answered 15 May '10, 12:31
I'm not sure whether the following will double-check the actual existance of the shell files but it should work and looks a little neater too:
answered 12 May '10, 17:54