When you log into the system you are placed in your home directory. The home directory is where your personal files and directories reside. The location of the home directory is determined by the system administrator. For instance when the user scot starts his session he will be placed in the /home/huron2/admin/scot directory.

Currently there are five major shells: Bourne, Korn, C-Shell, T-Shell and Bash. All of these support both foreground and background processes, pipes, filters, input/output redirection and other similar standard features of Unix.
The Bourne Shell was the original shell. It is the smallest shell and lacks many of the features of the other four shells. The Korn shell retains the complete functionality of the Bourne shell and includes some enhancements.
The C shell was developed at Berkeley and is useful for C language programmers. The T Shell retains the complete functionality of the C shell while adding many useful features, such as name completion and command line editing.
Bash or the GNU "Bourne Again Shell" incorporates many features of the Korn and C shell and follows the IEEE POSIX standard. Currently the T-shell is the most popular because it has "the most bells and whistles", however bash is gaining in popularity.
When a shell is started it looks for startup files that sets it behavior. The shell looks for system startup files and then it looks in your home directory($HOME) for personal startup files. These home startup files allows you to customize the behavior of the shell.
Table3.2: Shells -------------------------------------------------------------------- Shell Binary Default Prompt Home startup files -------------------------------------------------------------------- Bourne Shell sh $ $HOME/.profile Korn Shell ksh $ $HOME/.profile C-shell csh % $HOME/.cshrc T-shell tcsh % $HOME/.tcshrc or $HOME/.cshrc Bash bash bash$ $HOME/.bashrc --------------------------------------------------------------If you did not ask for a specific shell your system administrator has probably assigned you one. You can determine your shell, amoung other things, by using the finger command.
% ls -l total 1094 -rw-r----- 1 scot admin 242 Mar 7 17:00 Makefile -rwxr-xr-x 1 scot admin 542036 Mar 7 17:00 hello -rw-r--r-- 1 scot admin 70 Mar 7 17:00 hello.cc -rwxr-xr-x 1 scot admin 48 Mar 7 17:00 hello.plThe ls command is used to list files and directories. The -l options causes ls to give you a "long listing"of the files in a directory. If a command has more than one option they can be bundled together using a single minus sign. Not only can commands have options they can also have arguments. The command arguments are usually files. However, they can also be variables with values or possibly words to be match.
% grep hello greetings.txtThe grep command does pattern searching. This command will display every line in the file greetings.txt that contains the pattern hello.
Table3.4: Wildcards
----------------------------------------------------------------------
* Represent any arbitrary character string
? Represents any single character
[] Encloses a list of characters where the match is on `any single
character enclosed in the bracket.' The hyphen character is used
inside the bracket to indicate a range of characters.
----------------------------------------------------------------------
We can use wildcards to search for specific files
% ls [0-9]*.txtThis command will list all the files that begin with the character 0 through 9 and end with the character string ".txt". Wildcards can be used in any Unix command. They are not limited to the ls command.
You can set the permission of the file to allow access by certain classes of users. These three classes are the user, the users group and other. The user is the person who created the file. A group is a combination of users that can be used to restrict access. For instance, all faculty members could be in a group that allows them to see priviledged information. The last class is other, which is anyone with a username on your system.

These classes of users can have different combinations of read, write, execute (for a file) or search(for a directory) permissions. All together each file has nine permissions: three for owner, three for the owner's group, and three for others.
Table3.5: Permissions Examples
------------------------------------------------------------------------------------
Permission Meaning
------------------------------------------------------------------------------------
rw-r--r-- file is read/write for user, read only for both
the users group and other users
rwx------ file is read/write/execute for the user only
r-xr-xr-x file is read/execute for user, group and other
dr-xr-x--- directory is read/search for the user and his group
------------------------------------------------------------------------------------
The chmod command is used to change the permissions of a
file or directory.
% mailx scot < memoThe mailx command is one way to send electronic mail.This command will send the file memo to user scot.
% ls > listfileThis command will place a listing of all the file and directories into a file called listfile. If listfile already existed, previous contents of the file will be deleted. If you do not want to lose the contents of the file you could append to the end of the file by using two greater than symbols (>>).
We have discussed the standard input and standard output. However, Unix provides another output stream called standard error. The standard error is used to output any error messages that should not appear in the standard output, it is usually used for debugging purposes.
% ls nofile > listfile nofile not found %Here we have tried to list a file that does not exist. Notice that the error message is not placed in the file listfile, however the listfile is created.
% ls nofile >&2 listfile %The &2 tells the shell to send the standard output and the standard error to the file listfile.
Table3.6: Input/Output Redirection ------------------------------------------------------------------------ Symbol Action Shell ------------------------------------------------------------------------ < Redirect input from All > Redirect output to All >> Redirect output and append to All 2> Redirect standard error and output Korn,Bourne,Bash >&2 Redirect standard error and output C-shell, T-shell -------------------------------------------------------------------------
% ls -l | wc -l 29 %The wc command with the -l option gives you a count of lines. This command will pipe the output of our ls -l command to the wc(word count) command giving us the total number of files and directories in our current directory.
Pipes are not limited to two commands, by using filters you can have pipes of unlimited length.
Each time you execute a command an independent process is created to perform the command. Every command that has been executed has been a process, even the shell is a process. The system does not use the command name to keep track of the process, instead it knows a process by its process identification number(PID). To see what processes you currently have running on the system use the ps command.
% ps PID TTY TIME COMMAND 10315 ttyp5 0:00 ps 1548 ttyp5 0:00 tcshWe can see there are two processes running. The ps command which we just used to view the processes and tcsh which is our shell.