Shell Processes   «Prev  Next»
Lesson 2 The login shell
Objective First Shell when you login into UNIX account.

First Shell when you login into UNIX account

Which shell is run when you first login to your UNIX account.
When you first login to a shell account on a UNIX system, UNIX will start a shell for you and print a shell prompt on your screen. UNIX looks at the file /etc/passwd
[[The /etc/passwd file]]
to determine which shell you will use. This file is maintained by the system administrator for your system and contains login information for each user on the system. This information includes a user’s login name, home directory,login shell, and other information. Each line of the file shows information for a different login name on the system. The diagram below shows a sample line from this file.

sbarr59:abci+!.DSS243:209:1:/home/sbarr59:/bin/ksh

To change your default shell, ask your system administrator to change the /etc/passwd file.

You can use any shell you want

No matter what your login shell, you can change to a new interactive shell at any time.
You will learn more on this later in this module. You also may write shell scripts for any shell found on the machine regardless of the type of your login shell. Later in this module you will see how to indicate the shell for which a script was written.

Interactive shell

When a shell prints a prompt on your terminal screen and is waiting for you to enter commands, it is referred to as an interactive shell. The line where you type the commands is called the command line. When you run an interactive shell, it is functioning as a command line interface. Sometimes abbreviated CLI, this is a generic computer term referring to a program that presents you with a command line. The term command line interface is not restricted to shell programs.

Non-interactive shell

The shell may also be used as a programming language to string together a series of UNIX commands. This is a non-interactive use of the shell. Commands are typed into a file ahead of time and then run as a group. This course focuses on the non-interactive use of the shell.

Login Shell - Exercise

Click the exercise link below to practice looking up your own login shell in the /etc/passwd file.
login shell - Exercise
The next lesson is about shell processes.