Technical Note - Customising your UNIX environment
Summary
This document outlines how to customise your UNIX environment, and the risks involved.Details
Benefits of customisation
- To make your working environment more pleasant, such as changing your wallpaper to something more calming!
- To make it easier to do the things you want frequently, such as having programs start up when you log in.
- To make it possible to do things most other people don't want to do, such as using web authoring tools that are not enabled by default.
Risks of customisation
- If the ECS Programmers make upgrades to the default customisation files, either for bug fixes or feature upgrades, you may be screening yourself from these enhancements.
- If you don't know what you are doing, you can make mistakes which might make it impossible to use programs, or even to log in. Use caution!
How to customise
Optional software packages
Several utilities, or sets of utilities, are available on the system, but not enabled as standard for every user. This could be for any of a number of reasons, for example:- The utilities are not available on every one of our mixed bag of hardware platforms
- There are commands which might clash with something else
- Adding many commands for every user complicates their setup and may slow down their interaction with the system.
need
at the command prompt.
When you see a package you would like to enable, type need [package]
. To have this package loaded whenever you log in, you can add the command to your ~/.cshrc
file (don't move or remove the need SYSfirst
or need SYSlast
lines in here!)
Environment variables
Environment variables are definitions which are usually set in a shell, and then inherited by all the programs and processes which are started directly or indirectly by that shell. A few standard variables control the behaviour of a number of different programs:- EDITOR: Used by programs like
pine
andgripe
to determine which program to use to allow you to edit data. You might want to set this to/usr/pkg/bin/vim
,/usr/pkg/bin/emacs
or/usr/pkg/bin/pico
. - PRINTER: Used by
lpr
to determine the printer if none is specified. Most applications invokelpr
, so will inherit this setting. - PAGER: Used by programs like
man
to determine which program to control your window with. The default is often/usr/bin/more
, but many people prefer/usr/bin/less
.
~/.cshrc
file, for example:
... setenv EDITOR emacs setenv PAGER "/usr/bin/less" ...
Shell
The shell is the command-line interface you use. The ECS default is a shell calledtcsh
. The documentation is very long, so we'd suggest finding tutorials for things you might want to do. Three common tasks are changing the prompt (the beginning of the line where you type your command; you might want to know the folder you are in, or the current time, or such) defining new commands with alias
and putting programs or scripts in your PATH.
You would make all these, and any other, shell customisations in the file ~/.cshrc
.
MIT has selected the most popular variables for your shell prompt.
Norm Matloff at UC Davis has a good introduction to setting your PATH and aliases.
Changing shell from tcsh
to bash
or zsh
Advanced users only
Short answer: Don't do this.Long answer: Changing your shell.