You can typically tell which family your shell belongs to by a character in the prompt that it displays. Bourne-type shells, such as bash , usually have $ in the prompt. The C shell uses % (but tcsh users often use >). If the shell that you use has superuser privileges, then the prompt usually ends with a hash, #.

To check the shell that runs automatically when you log in to Unix or Linux, type the following command:

% grep yourloginname/etc/passwd

e.g. grep garyh /etc/passwd

You should get back the contents of your entry in the system password file. For example:

garyh:*:1006:1006:Gary Hall:/usr/home/garyh:/usr/local/bin/bash

The fields are separated by colons, and the default shell is usually identified in the last field.

Note that in Mac OS X, passwords are managed and stored in Netinfo by default. To store the passwords in /etc/passwd, you'll need to configure this using Netinfo.

Date Category Technology  Tags linux / shell
Gary Hall
Article by Gary Hall
A teacher based in Beverley, England. Enjoys walking, travelling, reading and writing interesting content to help others. Feel free to comment below.


comments powered by Disqus