| Previous | Table of Contents | Next |
UNIX ENVIRONMENT
The UNIX shell maintains an environment that controls how commands are interpreted and performed. A few of the more common environment variables and concepts are presented throughout the following paragraphs.
INPUT/OUPUT (I/O)
The UNIX System handles I/O as streams of data. The streams flow into and out of commands, files, or devices. The shell has three default types of I/O. The input stream is referred to as standard input and is usually generated by your terminal keyboard. The output stream is referred to as standard output and is usually displayed to your terminal screen. Standard error is error output from programs which also defaults to your terminal screen.
|
|
||
| Conventional Names | Default Device Input or Output is Connected to |
File Descriptor (Used by the Shell) |
|
|
||
| Standard Input | Terminal Keyboard (or from a pipe of file) | 0 |
| Standard Output | Terminal Screen (or to a pipe or file) | 1 |
| Standard Error | Terminal Screen (or to a pipe or file) | 2 |
|
|
||
REDIRECTION
The standard I/O can be redirected from your terminal to a file or a device. You can store data in files or send the contents to a command as input. Output from one command can be redirected to the input of another command. This is called "piping."
PATH NAMES
Pathnames are used to refer to directories and files not in the present working directory. A path is made up of a "/" followed by a subdirectory name or a filename, multiple "/" and subdirectories can be listed. Full pathnames begin with a "/", which denotes the root directory. Relative pathnames do not begin with a "/". Instead they start with a directory name or ".". There are several types of relative pahtnames. Subdirectory paths begin with the subdirectory's name, not a "/". Indirect paths begin with a "..", which allows dynamic backward movement within the file system.
cj> ls -x 300 300s 3bnstat 4014 450 Oar admin asa at awk b16as b16cc b16ckfile b16conv b16cprs b16dis b16dump b16ld . . .
|
|
|---|
| BSD (Berkeley) |
| The output for BSD systems is slightly different. |
|
|
PRESENT WORKING DIRECTORY
The present working directory is often referred to as the current working directory or current directory. Since the command that returns the present working directory is "pwd," we will refer to it as such. The UNIX System has file systems that are hierarchical tree structures containing directories and files.
HOME DIRECTORY
The system administrator created a directory for you somewhere in this hierarchy. When you log in you are positioned at this directory. This directory is known as your login or HOME directory. Since this is your home directory, you should own it and all the files under it. Therefore, you have full permissions to read, write, create, change, or delete the contents of your home directory.
TERMINAL TYPE
Certain UNIX commands must know what type of terminal you are using so they can interface with it correctly. You may need to contact your system administrator to find out what name UNIX uses for your terminal. The following steps show how to set your terminal type to a DEC VT100 terminal.
Other popular terminal types include:
| adm3 | adm5 | |
| ansi (pc) | hp | |
| tvi925 | tvi955 | |
| vt52 | vt220 | |
| wyse50 | wyse60 |
|
|
|
|---|---|
| C Shell | |
| Type set term=vt100 and press Return to set the TERM variable to vt100 for the current login shell. | |
|
|
|
|
|
|---|
| C Shell |
| The setenv command performs the same function as the SV export command. But the csh knows to export the term variable automatically. |
|
|
cj> env LOGNAME=mylogin MAIL=/usr/mail/mylogin ENV=/u1/ts/mylogin/env.ksh HOME=/u1/ts/mylogin TERM=vt100 PATH=:/bin:/usr/bin:/lbin:/usr/lbin:/u1/ts/mylogin/bin:. TZ=EST0EDT VISUAL=vi FCEDIT=vi SHELL=/bin/sh
|
|
|
|---|---|
| C Shell | |
| Type printenv to display environment variables. | |
|
|
|
SETTING/CHANGING YOUR PASSWORD
The passwd utility allows you to create or change the password associated with your user name. You can only change your password, you cannot change other users' passwords.
It is advisable to change your password the first time you log in on a multiuser system. Refer to Module 100 for a complete description of the passwd command.
| Previous | Table of Contents | Next |