Problem solve Get help with specific problems with your technologies, process and projects.

Know thy shells

Could you explain the technical differences between the major Linux shells (Bourne, C, Korn)? Is a login shell different from any other shell? If so, do you have any tips for using it?
The Linux Bourne shell (bash) is the standard for Linux and is the GNU version of the standard Bourne shell. It actually incorporates many features from csh and the Korn shell. Korn was developed from the original Bourne shell, not the born again bourne shell (bash), and incorporates many of the best features of earlier command processors, and is really a superset of the Bourne shell. though is not widely used in the Linux world. It's much more widely used in the Unix area (default shell under AIX). I would say that there are really no significant functional type differences between bash and korn that would warrant you going out and downloading it. I have heard some folks say that improved array features in Korn are important, as are improvements in using double precision arithmetic. You can pick up a copy of the korn shell from http://www.research.att.com/sw/download/.

Lastly, the C shell has a reputation for having many shortcuts, and as you can tell from the name, is C friendly and you'll do well with this if you know C. I am not particularly fond of the csh, as I find the syntax to be a bit tricky. Csh is also known to be a little slower then the other shells. Though there are many similarities, there are also plenty of differences when it comes to syntax, so my recommendation is to work with one only. If you want to choose one, stay with bash, the Linux bourne shell.

The Unix shell has two purposes, one is a scripting language, the other as a command line interpreter to run commands. When you say "login" shell, that is really the second purpose. Commands are being executed from that shell. As far as tips, I would try to familiarize yourself with the .profile, which in Unix is the first file that is looked at when you log in and is used to customize your environment. Put whatever setting you want here, and it will make your life much easier.

Dig Deeper on Linux servers

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.