Environments and Profile Files

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Environments and Profile files.

Unix systems have a set of environment variables and profile files that govern how your account works. The
Motif window manager and AIX Desktop systems have further variables and files for their default configurations.
Application software may use these variables and may define and use its own variables. You can also define variables
for your own use.
Environment variables are usually named all in capital letters They are not files and do not appear anywhere
in your directory. To see what the environment variables defined for a particular window of your account, type
printenv (setenv (?) for Sun machines). Changes to environment variables in one window do not necessarily affect
other windows. Here is an example of the result of the printenv command for my account em ardsg on matrix just
after I sign on.
_=/usr/bin/env
MANPATH=/usr/share/man:/usr/local/man
LANG=En_US
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/prime/%N
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/mat/ardsg/bin:/usr/bin/X11:/sbin:/us
r/local/bin:.
COLUMNS=80
WINDOWID=41943050
LOGNAME=ardsg
MAIL=/usr/spool/mail/ardsg
LOCPATH=/usr/lib/nls/loc
USER=ardsg
DISPLAY=:0.0
SHELL=/bin/ksh
ODMDIR=/etc/objrepos
HOME=/u/mat/ardsg
TERM=aixterm
MAILMSG=[YOU HAVE NEW MAIL]
PWD=/home/mat/ardsg
TZ=EST5EDT
ENV=/u/ardsg/.kshrc
LINES=25
A__z=! LOGNAME
You can use the contents of a variable by prefixing it by a $ sign. For example echo $HOME prints the value
of HOME to the screen and cd $HOME moves you back to your home directory. The variables of most interest to
you will probably be:
MANPATH specifies where to look for manual pages (i.e. for the man command).
LANG states which language (English, French, etc. you prefer to use.)
PATH is a list of directories the computer will search when it is looking for a command. If you are keeping your
executable files in a local directory (e.g. /home/mat/ardsg/bin), this could be added to the PATH variable.
DISPLAY specifies the name of the display you are using. Above it is not set. If you try to run mwm now, it
will fail. To identify the screen to matrix, I type export DISPLAY=room209d:0 and then mwm.
SHELL is the Korn shell here, but could be the C or Bourne shells.
HOME states the full path name of your home directory.
TERM specifies the type of terminal you are using. From an X terminal, this could be hft. Telnet sessions
usually result in terminal types of xterm or aixterm. Occasionally telnet sessions will not work right because
the computer is unable to identify the type of your terminal. You can then set TERM to be xterm or vt100 to
correct this.
PWD holds the full path name of your current directory. Thus pwd is the same as echo $PWD.

ENV holds the full path name of the file holding shell modifications. This is distinct from the env command!
Unix profile files usually set environment variables. For example, if you always use 50-line screens, you could
include env LINES=50 as a command. Profile files frequently have names of the form .filename and sit in your
home directory. The start-up file for a Korn shell (ksh) is in .kshrc, and for the C shell in .cshrc. The xinit command
will execute the commands in .xinitrc. For each sytem or application program using a profile file, there is usually
a heirarchy of system profile files upon starting the system will check and set profiles from a system (read-only)
directory, then check your local settings for deviations from that standard setup. Many of these standard profile files
will be found in the /etc directory, or in the directory holding the application software.
Some programs (e.g. pine, SAS etc) also create files or directories to hold their configuration information (e.g.
the sasuser directory). Some programs will allow you to modify their profile files from within that program others
will require that you edit the profile file directly from unix.
.profile The shell uses three types of profile files when you log in to the operating system: /etc/environment,
/etc/profile and (if it exists) the .profile file in your home directory. The /etc/environment and /etc/profile
file control profile variables for all users on a system whereas the .profile file allows you to customize your
own environments. At logon the /etc/profile file sets export variables, terminal types and mail messages. The
systems administrator sets this file. The second file read is .profile. Here you specify which shells to open,
environment variables (e.g. search path) and other local items; for example PATH or LANG.
.kshrc holds your modifications to the standard Korn shell.
.learnrc holds which lessons you have completed under the learn program. The learn command guides you
through lessons on files, editors, macros, EQN and C.
.xinitrc The xinit command looks to your .xinitrc (and if it does not exist, the /usr/lib/X11/$LANG/xinitrc
system file, etc.) for which XWindows programs to start when XWindows is invoked. For example, mwm
(AIXwindows window manager), aixterm, and xclock commands.
.mwmrc The mwm command needs to be told which mouse button does what and a variety of other things. I
suggest you avoid having a local .mwmrc file, and let the system defaults take effect.
.Xdefaults holds the colours, placement of icons etc. The custom item on the root menu will help change these
for you.
.Xauthority is a system file - do not touch.
.xdt3 states the values of environment variables used by the AIX Desktop System: the default editor and viewer.
These can be set from the menu bar on any Desktop window.
.signature, .pinerc, .addressbook, .estate, .pine-debug#, .mailrc as well as the mail and Mail directories are
related to you mail system. You can enter and edit the files in the mail directories if you wish.
calendar is a file in your home directory where you can store your appointments and reminders. At the
appropriate moment, your account will get an email reminding you of that event. This is not the cal command.
YourDesktop.dt is the file describing the desktop YourDesktop and its contents. You can edit this to change
your settings, although they are more easily saved from the Desktop menu bar. Please look at these files from
time to time, as they grow with every change you make to the Desktop. All the old versions of your desktop
are saved at the end of the file. Please erase all but the last few.

You might also like