A Basic UNIX Tutorial
A Basic UNIX Tutorial
This tutorial comprises fourteen sections, each of which addresses a fundamental aspect of UNIX
computing. It concentrates on illustrating the central concepts by providing short explanations, along
with examples, and exercises.
This tutorial covers the "Introduction to UNIX" and "Intermediate UNIX" workshops offered
by the Idaho State University Computer Center. Check the ISU workshop schedule to see
when the workshops are offered.
Table of Contents
What Is UNIX?
Input/Output Redirection
Managing processes.
Tips and tricks to enhance your efficiency with the command line interface.
The kernel
The kernel is the core of the Unix operating system. Basically, the kernel is a large program that is
loaded into memory when the machine is turned on, and it controls the allocation of hardware
resources from that point forward. The kernel knows what hardware resources are available (like the
processor(s), the on-board memory, the disk drives, network interfaces, etc.), and it has the necessary
programs to talk to all the devices connected to it.
Console
Every Unix system has a main console that is connected directly to the machine. The console is a
special type of terminal that is recognized when the system is started. Some Unix system operations
must be performed at the console. Typically, the console is only accessible by the system operators,
and administrators.
Dumb terminals
Some terminals are referred to as "dumb" terminals because they have only the minimum amount of
power required to send characters as input to the Unix system, and receive characters as output from
the Unix system.
Personal computers are often used to emulate dumb terminals, so that they can be connected to a
Unix system.
Dumb terminals can be connected directly to a Unix machine, or may be connected remotely,
through a modem, a terminal server, or other network connection.
Smart terminals
Smart terminals, like the X terminal, can interact with the Unix system at a higher level. Smart
terminals have enough on-board memory and processing power to support graphical interfaces. The
interaction between a smart terminal and a Unix system can go beyond simple characters to include
icons, windows, menus, and mouse actions.
Logging in
Logging in to a Unix system requires two pieces of information: A username, and a password. When
you sit down for a Unix session, you are given a login prompt that looks like this:
login:
Type your username at the login prompt, and press the return key. The system will then ask you for
your password. When you type your password, the screen will not display what you type.
Your username
Your username is assigned by the person who creates your account. At ISU, the standard username is
the first four letters of your last name concatenated with the first four letters of your first name.
Your username must be unique on the system where your account exists since it is the means by
which you are identified on the system.
Your password
When your account is created, a password is assigned. The first thing you should do is change your
password, using the passwd utility. To change your password, type the command
passwd
after you have logged in. The system will ask for your old password, to prevent someone else from
sneaking up, and changing your password. Then it will ask for your new password. You will be
asked to confirm your new password, to make sure that you didn't mistype. It is very important that
you choose a good password, so that someone else cannot guess it. Here are some rules for selecting
a good password:
● Do not use any part of your name, your spouse's name, your child's name, your pet's name, or
anybody's name. Do not use any backward spellings of any name, either.
● Do not use an easily-guessable number, like your phone number, your social security number,
your address, license plate number, etc.
● Do not use any word that can be found in an English or foreign-language dictionary.
● Do not use all the same letter, or a simple sequence of keys on the keyboard, like qwerty.
● Do use a mix of upper-case and lower-case letters, numbers, and control characters.
● Do use at least six characters.
If you have accounts on multiple machines, use a different password on each machine. Do not
choose a password that is so difficult to remember that you must write it down.
Logging Out
When you're ready to quit, type the command
exit
Before you leave your terminal, make sure that you see the login prompt, indicating that you have
successfully logged out. If you have left any unresolved processes, the Unix system will require you
to resolve them before it will let you log out. Some shells will recognize other commands to log you
out, like "logout" or even "bye".
It is always a good idea to clear the display before you log out, so that the next user doesn't get a
screenful of information about you, your work, or your user account. You can type the command
clear
right before you log out, or you can press the return key until all the information is scrolled off the
screen.
Edited by Foxit PDF Editor
Copyright (c) by Foxit Software Company, 2004 - 2007
For Evaluation Only.
The shell recognizes a limited set of commands, and you must give commands to the shell in a way
that it understands: Each shell command consists of a command name, followed by command
options (if any are desired) and command arguments (if any are desired). The command name,
options, and arguments, are separated by blank space.
CONCEPT: The shell is a program that the Unix kernel runs for you. A program is referred to as a
process while the kernel is running it. The kernel can run the same shell program (or any other
program) simultaneously for many users on a Unix system, and each running copy of the program is
a separate process.
Many basic shell commands are actually subroutines built in to the shell program. The commands
that are not built in to the shell require the kernel to start another process to run them.
CONCEPT: When you execute a non built-in shell command, the shell asks the kernel to create a
new subprocess (called a "child" process) to perform the command. The child process exists just
long enough to execute the command. The shell waits until the child process finishes before it will
accept the next command.
Edited by Foxit PDF Editor
Copyright (c) by Foxit Software Company, 2004 - 2007
For Evaluation Only.
EXERCISE: Explain why the exit (logout) procedure must be built in to the shell.
EXPLANATION: If the logout procedure were not built in to the shell, the kernel would start a new
child process to run it. The new process would logout, and then return you to the original shell. You
would thus find yourself back where you started, without having logged out.
Unlike DOS, the Unix shell is case-sensitive, meaning that an uppercase letter is not equivalent to
the same lower case letter (i.e., "A" is not equal to "a"). Most all Unix commands are lower case.
Viewing permissions
To see the permissions on a file, use the ls command, with the -l option.
EXAMPLE: Execute the command
ls -l /etc/passwd
to view the information on the system password database. The output should look similar to this:
-rw-r--r-- 1 root sys 41002 Apr 17 12:05 /etc/passwd
The first 10 characters describe the access permissions. The first dash indicates the type of file (d for
directory, s for special file, - for a regular file). The next three characters ("rw-") describe the
permissions of the owner of the file: read and write, but no execute. The next three characters ("r--")
describe the permissions for those in the same group as the owner: read, no write, no execute. The
next three characters describe the permissions for all others: read, no write, no execute.
Setting permissions
Unix allows you to set the permissions on files that you own. The command to change the file
permission mode is chmod. Chmod requires you to specify the new permissions you want, and
specify the file or directory you want the changes applied to.
To set file permissions, you may use to the "rwx" notation to specify the type of permissions, and the
"ugo" notation to specify those the permissions apply to.
To define the kind of change you want to make to the permissions, use the plus sign (+) to add a
permission, the minus sign (-) to remove a permission, and the equal sign (=) to set a permission
directly.
EXAMPLE: Type the command
chmod g=rw- ~/.shrc
to change the file permissions on the file .shrc, in your home directory. Specifically, you are
specifying group read access and write access, with no execute access.
EXERCISE: Change the permissions on the .shrc file in your home directory so that group and
others have read permission only.
EXPLANATION: Typing the command
chmod go=r-- ~/.shrc
would accomplish the task.
You can also combine multiple operation codes in a single statement. Separate each operation code
with a comma, and do not have any embedded space anywhere in the operation code sequence. For
example:
chmod u=rwx,go=r-x foo
Would set owner permissions to rwx, with group and other permissions set to r-x.
Changing Directories
In Unix, your location in the filesystem hierarchy is known as your "current working directory."
When you log in, you are automatically placed in your "home directory." To see where you are, type
the command
pwd
which stands for "print working directory."
To change your location in the filesystem hierarchy, use the cd (change directory) command,
followed by an argument defining where you want to go. The argument can be either an absolute
path to the destination, or a relative path.
EXAMPLE: Type the command
cd /tmp
to go to the /tmp directory. You can type
pwd
to confirm that you're actually there.
If you type the cd command without an argument, the shell will place you in your home directory.
EXERCISE: Type the command
pwd
and note the result. Then type
cd ..
to the shell. Type
pwd
again to see where you ended up.
EXPLANATION: The "cd .." command should have moved you up one level in the directory tree,
because ".." is Unix shorthand for the parent directory. The result of the second "pwd" command
should be the same as the first, with the last directory in the path omitted.
EXPLANATION: There are many ways to accomplish this. You could type
cd
to get to your home directory, and then type
ls -la
The -a option instructs the ls command to list all files, including those that start with the period
character (ls normally ignores files that begin with a period). The directory permissions are listed
next to the "." symbol. Remember that "." is Unix shorthand for the current working directory.
The rm command is used for removing files and directories. The syntax of the rm command is rm
filename. You may include many filenames on the command line.
EXAMPLE: Remove the the shrccopy file that you placed in your home directory in the section on
moving files by typing
rm ~/.shrccopy
Creating a directory
The Unix mkdir command is used to make directories. The basic syntax is mkdir directory-name.
If you do not specify the place where you want the directory created (by giving a path as part of the
directory name), the shell assumes that you want the new directory placed within the current working
directory.
EXAMPLE: Create a directory called foo within your home directory by typing
mkdir ~/foo
EXERCISE: Create a directory called bar, within the directory called foo, within your home
directory.
EXPLANATION: Once the foo directory is created, you could just type
mkdir ~/foo/bar
Alternately, you could type
cd ~/foo; mkdir bar
In the second solution, two Unix commands are given, separated by a semicolon. The first part of the
command makes foo the current working directory. The second part of the command creates the bar
directory in the current working directory.
Removing a directory
The Unix rmdir command removes a directory from the filesystem tree. The rmdir command does
not work unless the directory to be removed is completely empty.
The rm command, used with the -r option can also be used to remove directories. The rm -r
command will first remove the contents of the directory, and then remove the directory itself.
EXERCISE: Describe how to remove the "foo" directory you created, using both rmdir, and rm
with the -r option.
EXPLANATION: You could enter the commands
rmdir ~/foo/bar; rmdir ~/foo
to accomplish the task with the rmdir command. Note that you have to rmdir the bar subdirectory
before you can rmdir the foo directory. Alternately, you could remove the foo directory with the
command
rm -r ~/foo
Section 6: Redirecting Input and Output
CONCEPT: Every program you run from the shell opens three files: Standard input, standard
output, and standard error. The files provide the primary means of communications between the
programs, and exist for as long as the process runs.
The standard input file provides a way to send data to a process. As a default, the standard input is
read from the terminal keyboard.
The standard output provides a means for the program to output data. As a default, the standard
output goes to the terminal display screen.
The standard error is where the program reports any errors encountered during execution. By default,
the standard error goes to the terminal display.
CONCEPT: A program can be told where to look for input and where to send output, using
input/output redirection. Unix uses the "less than" and "greater than" special characters (< and >) to
signify input and output redirection, respectively.
Redirecting input
Using the "less-than" sign with a file name like this:
< file1
in a shell command instructs the shell to read input from a file called "file1" instead of from the
keyboard.
EXAMPLE:Use standard input redirection to send the contents of the file /etc/passwd to the more
command:
more < /etc/passwd
Many Unix commands that will accept a file name as a command line argument, will also accept
input from standard input if no file is given on the command line.
EXAMPLE: To see the first ten lines of the /etc/passwd file, the command:
head /etc/passwd
will work just the same as the command:
head < /etc/passwd
Redirecting output
Using the "greater-than" sign with a file name like this:
> file2
causes the shell to place the output from the command in a file called "file2" instead of on the screen.
If the file "file2" already exists, the old version will be overwritten.
EXAMPLE: Type the command
ls /tmp > ~/ls.out
to redirect the output of the ls command into a file called "ls.out" in your home directory. Remember
that the tilde (~) is Unix shorthand for your home directory. In this command, the ls command will
list the contents of the /tmp directory.
Use two "greater-than" signs to append to an existing file. For example:
>> file2
causes the shell to append the output from a command to the end of a file called "file2". If the file
"file2" does not already exist, it will be created.
EXAMPLE: In this example, I list the contents of the /tmp directory, and put it in a file called myls.
Then, I list the contents of the /etc directory, and append it to the file myls:
ls /tmp > myls
ls /etc >> myls
Redirecting error
Redirecting standard error is a bit trickier, depending on the kind of shell you're using (there's more
than one flavor of shell program!). In the POSIX shell and ksh, redirect the standard error with the
symbol "2>".
EXAMPLE: Sort the /etc/passwd file, place the results in a file called foo, and trap any errors in a
file called err with the command:
sort < /etc/passwd > foo 2> err
Section 7: Pipelines and Filters
CONCEPT: Unix allows you to connect processes, by letting the standard output of one process
feed into the standard input of another process. That mechanism is called a pipe.
Connecting simple processes in a pipeline allows you to perform complex tasks without writing
complex programs.
EXAMPLE: Using the more command, and a pipe, you can manage the screen presentation of
command output. Examine the contents of the /etc directory by typing
ls -l /etc | more
to the shell.
If you type "q" to exit the more command, where does the remaining output of the ls command go?
The answer lies in the way pipelined processes communicate. When the kernel creates a process,
each of the process's three file descriptors (standard input, standard output, standard error) is
assigned an area, occupying a small block of the computer's memory. The pipeline is established
when the contents of the ls command's output buffer is copied into the input buffer of the more
command. When the more command is terminated, the Unix operating system will terminate the ls
command, as it has nowhere to copy it's output.
EXERCISE: How could you use head and tail in a pipeline to display lines 25 through 75 of a file?
ANSWER: The command
cat file | head -75 | tail -50
would work. The cat command feeds the file into the pipeline. The head command gets the first 75
lines of the file, and passes them down the pipeline to tail. The tail command then filters out all but
the last 50 lines of the input it received from head. It is important to note that in the above example,
tail never receives the original file, but only sees the 75 lines that were passed to it by the head
command.
It is easy for beginners to confuse the usage of the input/output redirection symbols < and >, with the
usage of the pipe. Remember that input/output redirection connects processes with files, while the
pipe connects processes with other processes.
Grep
The grep utility is one of the most useful filters in Unix. Grep searches line-by-line for a specified
pattern, and outputs any line that matches the pattern. The basic syntax for the grep command is
grep [-options] pattern [file]. If the file argument is omitted, grep will read from standard input. It
is always best to enclose the pattern within single quotes, to prevent the shell from misinterpreting
the command.
The grep utility recognizes a variety of patterns, and the pattern specification syntax was taken from
the vi editor. Here are some of the characters you can use to build grep expressions:
● The caret (^) matches the beginning of a line.
● The asterisk (*) matches zero or more occurrences of the previous character.
● The expression [a-b] matches any characters that are lexically between a and b.
Note that some of the pattern matching characters are also shell meta characters. If you use one of
those characters in a grep command, make sure to enclose the pattern in single quote marks, to
prevent the shell from trying to interpret them.
EXAMPLE: Type the command
grep 'jon' /etc/passwd
to search the /etc/passwd file for any lines containing the string "jon".
EXAMPLE: Type the command
grep '^jon' /etc/passwd
to see the lines in /etc/passwd that begin with the character string "jon".
EXERCISE: List all the files in the /tmp directory owned by the user root.
EXPLANATION: The command
ls -l /tmp | grep 'root'
would show a long listing of all files in the /tmp directory that contain the word "root". Note that
files not owned by the root user may contain the string "root" somewhere in the name, and would
appear in the output, but the grep filter can cut the down the number of lines of output you will have
to look at.
Section 8: Process Control and Multitasking
CONCEPT: The Unix kernel can keep track of many processes at once, dividing its time between
the jobs submitted to it. Each process submitted to the kernel is given a unique process ID.
Single-tasking operating systems, like DOS, or the Macintosh System, can only perform one job at a
time. A user of a single-tasking system can switch to different windows, running different
applications, but only the application that is currently being used is active. Any other task that has
been started is suspended until the user switches back to it. A suspended job receives no operating
system resources, and stays just as it was when it was suspended. When a suspended job is
reactivated, it begins right where it left off, as if nothing had happened.
The Unix operating system will simultaneously perform multiple tasks for a single user. Activating
an application does not have to cause other applications to be suspended.
Actually, it only appears that Unix is performing the jobs simultaneously. In reality, it is running
only one job at a time, but quickly switching between all of its ongoing tasks. The Unix kernel will
execute some instructions from job A, and then set job A aside, and execute instructions from job B.
The concept of switching between queued jobs is called process scheduling.
Viewing processes
Unix provides a utility called ps (process status) for viewing the status of all the unfinished jobs that
have been submitted to the kernel. The ps command has a number of options to control which
processes are displayed, and how the output is formatted.
EXAMPLE: Type the command
ps
to see the status of the "interesting" jobs that belong to you. The output of the ps command, without
any options specified, will include the process ID, the terminal from which the process was started,
the amount of time the process has been running, and the name of the command that started the
process.
EXAMPLE: Type the command
ps -ef
to see a complete listing of all the processes currently scheduled. The -e option causes ps to include
all processes (including ones that do not belong to you), and the -f option causes ps to give a long
listing. The long listing includes the process owner, the process ID, the ID of the parent process,
processor utilization, the time of submission, the process's terminal, the total time for the process,
and the command that started the process.
EXERCISE: Use the ps command, and the grep command, in a pipeline to find all the processes
owned by you.
EXPLANATION: The command
ps -ef | grep yourusername
where "yourusername" is replaced by your user name, will cause the output of the ps -ef command to
be filtered for those entries that contain your username.
Killing processes
Occasionally, you will find a need to terminate a process. The Unix shell provides a utility called kill
to terminate processes. You may only terminate processes that you own (i.e., processes that you
started). The syntax for the kill command is kill [-options] process-ID.
To kill a process, you must first find its process ID number using the ps command. Some processes
refuse to die easily, and you can use the "-9" option to force termination of the job.
EXAMPLE: To force termination of a job whose process ID is 111, enter the command
kill -9 111
Edited by Foxit PDF Editor
Copyright (c) by Foxit Software Company, 2004 - 2007
For Evaluation Only.
Starting emacs
Quitting emacs
To exit emacs and return to the Unix shell, type Control-X-Control-C. If you have made changes to
the buffer since the last time you saved it to disk, emacs will ask you if you want to save. Type y for
yes, or n for no.
Getting help
Emacs has an on-line help system that can be invoked by typing Control-H. If you type the question
mark (?), emacs will present a list of help topics you can choose.
Aborting a command
You can abort an emacs control or escape sequence by typing the command Control-G.
Cursor motion
On well-configured systems, you will find that the keyboard arrow keys will function correctly in
emacs, moving you forward or backward one character at a time, and up or down one line at a time.
If the arrow keys do not work, here's how to accomplish the same functions:
● Control-F moves the cursor forward to the next character.
In addition to basic cursor motion, emacs provides some other handy cursor motion functions:
● Control-A moves the cursor to the start of the current line.
Undoing changes
It is possible to undo the changes you have made to a file by entering the command Control-_.
(That's Control-underscore. On some keyboards, you'll have to hold down both the control and shift
keys to enter the underscore character.)
Many word processing programs can only undo the most recent command, but emacs remembers a
long history of commands, allowing you to undo many changes by repeatedly entering the Control-_
code.
Customizing Emacs
The emacs editor is customizable in several ways. You can set up your own key bindings, create
your own macros, and even create your own custom functions. Also, some aspects of the behavior of
emacs is controlled by variables that you can set.
You can learn more about emacs functions by invoking the online help facility (by typing ESC-X
help) and then typing the "f" key to list functions. Pressing the space bar for completion will cause
emacs to list all the built-in functions. A list of variables can be similarly obtained by invoking the
online help, then typing "v" then the spacebar.
If you place variable settings, key bindings, and function declarations, in a text file called ".emacs"
in your home directory, The emacs editor will load those definitions at startup time. Here is an emacs
configuration file with some basic variable definitions and key bindings for you to peruse.
Section 11: The Execution Environment
CONCEPT: The exact behavior of commands issued in the shell depends upon the execution
environment provided by the shell.
The Unix shell maintains a set of environment variables that are used to provide information, like the
current working directory, and the type of terminal being used, to the programs you run. The
environment variables are passed to all programs that are not built in to the shell, and may be
consulted, or modified, by the program. By convention, environment variables are given in upper
case letters.
To view all the environment variables, use the command
printenv
You can also view a particular environment variable using the echo command:
echo $TERM
The above command echos the value of the TERM environment variable to the standard output.
To set your umask to deny write permission to group and others, use the command
umask 022
To deny all access to group and others, use the command
umask 077
Some versions of Unix provide a more user-friendly way of specifying your umask. In HP-UX sh-posix (or ksh), you are allowed to specify the access permissions in manner of the chmod command. The command
umask u=rwx,g=r,o=r
would set the umask to deny write and execute permissions to the group, and to others. That kind of command syntax will not work in HP-UX's C shell or Bourne shell. The HP-UX posix shell also allows the use of the command
umask -S
to print your umask setting in a more readable fashion.
#!/bin/posix/sh
#******************************************************************************
# Run the script .shrc in every subshell.
#******************************************************************************
ENV="$HOME/.shrc";export ENV
#******************************************************************************
# Leave a sign of last login in user's home directory
# Remove this line if you don't want such records left.
# All logins are logged elsewhere, anyway.
#******************************************************************************
touch $HOME/.lastlogin
chmod 600 $HOME/.lastlogin
#******************************************************************************
# THREE TYPES OF TERMINAL-CHOOSING MECHANISMS ARE PRESENTED BELOW. ONLY
# ONE SHOULD BE USED. AUTOMATIC DETECTION OF TERMINAL TYPE IS THE DEFAULT.
#******************************************************************************
#******************************************************************************
# Uncomment the following line (i.e. remove # at the beginning of line)
# to make it so you're prompted for terminal type at login (rather than
# having term type hard-coded or having the system automatically detect
# your terminal type). Replace 'vt220' with another term type if you want a
# different default terminal type presented with the user prompt.
#******************************************************************************
# eval ` tset -s -Q -m ":?vt220" `
#******************************************************************************
# Uncomment the following line (i.e. remove # at beginning of line)
# if you want to hard-code a terminal type.
# Replace 'vt220' with any desired terminal type. Use this option only if
# you are always using the same type of terminal, and if the system doesn't
# seem to properly detect your terminal type.
#******************************************************************************
# TERM=vt220
#******************************************************************************
# If you chose either of the above terminal-choosing options, comment out
# the following section from 'if' to 'fi' (insert a # at the beginning of
# each line). Otherwise, the default terminal handling for terminal access
# is to have the system attempt to detect your terminal type.
#******************************************************************************
if [ "${TERM}X" = "X" ]
then
TERM=`ttytype`
case $TERM in
*2382* | *2392* | *2393* | *2394* | *2397* | *2621* ) TERM="hp" ;;
*2621* | *2622* | *2623* | *2624* | *2625* | *2626* ) TERM="hp" ;;
*2627* | *2628* | *2640* | *2641* | *2644* | *2645* ) TERM="hp" ;;
*2647* | *2648* | *2649* | *150* | *70092* | *70094* ) TERM="hp" ;;
esac
fi
#*****************************************************************************
# Leave this line alone: it applies for all terminal-setting options
#*****************************************************************************
export TERM
#******************************************************************************
# Set up the terminal:
#******************************************************************************
stty hupcl ixon ixoff ienqak -parity
stty erase "^H" kill "^U" intr "^C" eof "^D" susp "^Z"
tabs
#*****************************************************************************
# Display little menu of options
#*****************************************************************************
/usr/local/bin/menu
#!/bin/posix/sh
#*****************************************************************************
# Set default permissions so that you can read and write all files, and that
# others can't. Changing this can potentially mess up the security of your
# account, so make sure you know what you're doing before changing this.
#*****************************************************************************
umask 077
#******************************************************************************
# set paths: PATH tells the shell where to look for programs/commands when
# you type command or program names. MANPATH tells the shell where to look
# for Unix 'man' pages. NNTPSERVER tells news readers to get Usenet news from
# the cwis computer.
#******************************************************************************
PATH=$HOME/bin:.:/bin/posix:/bin:/usr/bin:/usr/contrib/bin:/usr/local/bin:/usr/bin/X11:/usr/local/bin/X11:/usr/contrib/bin/X11:/share/gen/bin:/share/X11/bin
MANPATH=/usr/man:/usr/local/man:/usr/contrib/man:/share/gen/man:/share/X11/man
NNTPSERVER=localhost
#******************************************************************************
# Set up the shell environment variables:
# HOST and GROUPNAME get set for old cwis menus.
# If you want an editor other than pico (like vi or emacs) to be your default
# editor, replace pico with the name of your preferred editor.
# HISTSIZE determines how many of your previous commands are retained for
# recalling.
# The line with PAGER determines the default pager to use for reading through
# documents one page at a time.
# The line with LESS makes it so informative keystroke prompts are put at the
# bottom of the screen when using the less pager.
# LPDEST determines which printer queue your print jobs submitted with the lp
# command go to. This line is changed by the 'printers' program, so try
# not to radically alter this line. You can manually change the queue name
# here if you want to.
#******************************************************************************
export HOST=`hostname`
export GROUPNAME=`groups -p $LOGNAME`
EDITOR=pico;export EDITOR
HISTSIZE=200;export HISTSIZE
PAGER="less";export PAGER
LESS='-c -P spacebar\:page ahead b\:page back /\:search ahead \?\:search back h\:help
q\:quit';export LESS
LPDEST=laser_q2;export LPDEST
#*****************************************************************************
# Treat unset parameters as an error when substituting.
# Don't mess with this unless you're a guru.
#*****************************************************************************
set +u
#*****************************************************************************
# Make it so your terminal is not open to talk requests and placement of
# comments on your screen by other users. Change this line to 'mesg y' if
# you want to be open to talk requests by default. Otherwise, you can type
# 'mesg y' within a session to temporarily open yourself for talk requests.
#*****************************************************************************
mesg n
#*****************************************************************************
# Set up shell for vi-style command line editing (i.e. recalling commands with
# ESC-k, and using vi editor keystrokes to edit command lines).) If you prefer,
# you can replace 'vi' with 'emacs' for emacs-style command line editing (i.e.
# recalling commands with control-P, and using emacs editor keystrokes to edit
# the command line.
#*****************************************************************************
set -o vi
#*****************************************************************************
# Define user prompt to show hostname and current directory.
# This can be changed to anything.
# Change it to
#
# PS1 = 'GET TO WORK, BOZO!! '
#
# if you want the command prompt to repeatedly insult you.
#*****************************************************************************
PS1='cwis:$PWD
$ '
#****************************************************************************
# Create custom commands. All can be removed/altered *except* 'printers.
# Feel free to create your own custom commands.
# The command 'printers' is necessary for the proper functioning of the cwis
# printer-choosing utility. The 'printers' program changes the line that
# sets default printer queue in this file, and this file gets "run" again
# to load the new value into the user environment.
# The command 'more' is altered to call the more capable 'less' pager. Disable
# this alias if you want to use the 'more' pager.
# The command 'ls' is set up to identify executable
# files with an * and directories with a /. Remove this alias if you want
# the ls command to behave normally, i.e. without the * and /.
# The command 'edit' is set up to call default editor (see EDITOR=... above).
# The command 'oldmenu' brings up the old cwis menus.
# The command 'logout' calls the Unix command 'exit' to log out.
# The command 'webperms' sets up file permissions to be world-readable, for
# web publishing.
# The command 'regperms' returns file permissions to readable by user only.
#****************************************************************************
alias printers="/share/gen/bin/printers;. $HOME/.shrc"
alias more="less"
alias ls="ls -F"
alias dir="ls -F"
alias edit="$EDITOR"
alias oldmenu=". /usr/local/bin/cwis2"
alias logout="exit"
alias quit="exit"
alias bye="exit"
alias log="exit"
alias webperms="umask 022;chmod -R a+r $HOME/public_html"
alias regperms="umask 077"
Edited by Foxit PDF Editor
Copyright (c) by Foxit Software Company, 2004 - 2007
For Evaluation Only.