Introduction to UNIX
What is HP-UX?
HP-UX is Hewlett-Packard Company's implementation of Unix.
It is based on
AT&T UNIX* System V Release 2 operating system, but also includes
important features from Berkeley Software Distribution 4.2.
The UNIX shell and the Kernel
The kernel is the heart of the UNIX operating system.
Usually only programs talk to the kernel (through system calls).
As users, we talk to the shell.
It is the shell which interprets our commands and
either executes programs or requests other services from the kernel.
There are several shells available; the one generally used on
our system is called the KORN shell (ksh).
When you wish to interact with the
the shell, you must exit from the menu provided at login.
When finished
using the shell, typing exit will either return to the menu
where you can Quit, or if you do not currently have a menu, will
log you off the system.
The UNIX File System
The UNIX file system is very similar to that of MS-DOS.
It is organized
hierarchically into directories for efficient organization.
A directory is simply a special type of file - it is a file which
contains a list of files.
After logging in, the home directory assigned
to you becomes your current working directory.
To change the current working directory us cd.
Path Names are used to refer to files not in your current directory.
Path names tell the system where files are located.
Full (absolute) path
names begin with /, which is the name of the top or root
directory of the whole file system.
After the initial / comes the
name of each subdirectory followed by a /,
until finally the file name is reached (e.g.
/users/able1234/mail/saved-messages).
Relative paths are more convenient because they are shorter,
but must be used with care.
They never begin with /.
For example to refer to a file
in my mail subdirectory, when I am in my home directory, I can simply
start with the name of the subdirectory (e.g. mail/saved-messages).
Useful Directory Commands
Although a directory is simply a list of files, there is a special
command to display the contents of a directory.
ls lists the contents of a directory (except for system files)
ls -a lists all the contents of a directory, including system files
ls -l same as ls with additional information
ls -lt same as "ls -l" except the list is sorted by time modified
(latest first)
To change directories, use cd.
cd mail changes to your mail directory
cd .. changes to the directory immediately above the current
working directory.
To display the full path to
the current working directory, use pwd.
To list the subdirectories in the current working directory
the following
command is useful: ls -d */. (the period is important)
To create a new subdirectory use mkdir (e.g. "mkdir foobar").
Displaying the Contents of a File on the Screen
Any text file can be displayed with several utilities or it can be edited
with an editor like pico or vi. If it is a long file
the command more will scroll the contents, pausing after each
screen (e.g. "more mail/sent-mail"). If you don't care about the pauses,
use cat (e.g. "cat mail/sent-mail"). ("cat" is derived from
"conCATenate")
To actually modify or create your mail
signature file you would use pico (or vi) (e.g. "pico .signature").
Printing a File
Any text file can be printed with the lp command. For example,
if you wanted to print a file named resume to the printer in
the LeMans PC Lab, you would use the command
lp -dlmpc5simx resume
Useful File Commands
To rename a file, use mv (e.g. "mv .signature .signature.old").
To copy a file, use cp (e.g. "cp file1 programs/file1"). The
first filename given is the one being copied, the second filename will be
the one created by the copy command.
To delete a file, use rm (e.g. "rm junk").
Changing Your Password
The UNIX command to change your password is passwd.
For more information on the password command, see the on-line
Passwords Guide
UNIX Manual Pages
The full HP-UX
Manual describing any command is accessible from the UNIX shell using
the "man" command.
man - find manual information by keywords:
SYNOPSIS
man -k keyword (produces a one-line entry for all commands
whose one-line description contains the keywords)
man command ... (for the full description of the command)
Examples
Show the manual entry for the lp command
man lp
Back to
Helpful Computing Guides
Last Updated 12/10/97