There are certain questions that get asked over and over and over again in
about UNIX. To learn the "basics" work through the Q&A session.
To speed up the process for those who know what they're looking for, a table
of contents follows. Newcomers to UNIX should read this entire document. As
you learn more read it over again.... it's a helpful reference for UNIX trivia.
-
Read the fine manual. Some people use a different word in place of fine - this is optional.
-
The manpages are a large "online manual" found in almost all dialects of UNIX.
Manpages can be referenced by either command or topic. If you want
instructions on the use of a certain command (for example, chmod the command
to change read/write/execute permissions for files), simply type
man chmod. If you are unsure about specific commands, but have
a general topic you want to search for (for example, permission) type
man -k permission.
Don't try it with a really common word (unless
you like to check how fast the monitor can scroll); man -k file is not
recommended.
-
UNIX is a true preemptive multitasking operating system, unlike any
other. It is the most portable operating system, unlike ones such as
MS-DOS, WFW, Win95, Amiga-DOS and Mac System 8 that only run on certain machines.
UNIX runs on doorstops (8088's, 286's, Altos) to personal computers (IBMs,
Macs, Amigas, 3b1, Atari ST) to workstations (Suns, SGI's, NeXTs,
HP's, Dec's), to supercomputers (Crays, Thinking Machines), and many more.
It's quite efficient, and crashes very infrequently. Many workstations survive
for 3-6 months without a crash!! It is very unlike Windows 95 which rarely lasts 3-6 hours.
UNIX is also a multiuser operating system. This means that
more than one user can use the same computer (programs, filesystem, memory,
CPU) by logging in on different ports (serial, ethernet, Internet, etc.)
-
UNIX was born in 1969 at Bell Laboratories. It was written by Ken Thompson with
help from Rudd Canaday, Doug McIlroy, Joe Ossanna and Denis Richie. In 1973, Dennis Richie
and Ken Thompson rewrote the UNIX kernel (the heart of the OS) in C (a high level
programming language). Because UNIX is written in C it is highly portable. Because
the source code is freely available it is highly adaptable and easy to "fix".
-
No, UNIX is not an acronym. Unix is a "play on words" of an older
multiuser time-sharing OS known as Multics. UNIX was also originally
designed as a single user environment (hence "U"nix). The people who designed
UNIX obviously wear sox and call irish people mix and get their kix on route sicksty
sicks. Which makes them ....
Most versions of UNIX end in "x" like Ultrix, AIX, IRIX, Xenix, Linux, HPUX. Sun
Microsystems like to end their version names in "s" (? go figure) hence SunOS and Solaris.
-
Typing uname -a will give you a result much like these:
- SunOS outer 4.1.3_U1 4 sun4c
- IRIX hyperlinks 5.3 11091812 IP22 mips
- Linux slugbox 1.2.7 #1 Tue Jul 4 11:05:37 PDT 1995 i386
These people are running SunOS (Sun), IRIX (SGI), and Linux (x86)
respectively. Look at the first and third fields of this output will tell
you your OS type and kernel version. The second field is the machine name and
the last field contains the machine type sun4c, mips, i386.
-
There are many good books on learning almost every aspect of the UNIX
operating system in its many forms. Other books cover individual utilities
used in Unix. The books published by O'Reilly and
Associates (ORA) are generally recognized to be comprehensive and easy to understand.
"The UNIX programming environment" by Brian Kernighan and Rob Pike is a solid introductory guide.
-
UNIX protects itself in many ways - hence the lack of crashes. Sometimes the
protected parts of the system need to be fixed or changed. Root is a superuser with
special privileges to make such changes. Being logged in as root is usually a
bad idea. You can inflict only minor damage as a regular user but as root the
system is vulnerable to your mistakes. The system administrator is usually the only
person with root privileges on the system. When you have problems you can send
mail to root@(machine_name) for example, root@pangea and it
should find the right person.
-
It's as simple as ls (short for list, the authors of unix are fond of brevity hence the commands cp, ls, mv, ps, rm ....etc. There are many options for ls; see the
manpage. ls -l is a little more informative than ls alone.
-
Use chmod. For the beginner, chmod is a complex command, and
we suggest you read the manpage. Here are some starter tips;
- To make your .plan world-readable: chmod a+r .plan
- To make your directory secure: chmod go-rwx $HOME or chmod 700 $HOME
- To make a directory and its contents read/writable by everyone: chmod -r a+rwx dir or chmod 777 dir
-
For files, rm file. For directories, rm -r directory.
If you want everything to be removed without question, use \rm -rf.
-
The ability to set up aliases is a major feature of many Unix shells. For example,
refugees from MS-DOS like to use aliases like alias copy cp and alias
dir 'ls -l'. Aliases similar to alias mywork 'cd /work0/darcy/reeves/work'
enable frequently used or complex command strings to be saved in a succint form.
-
The finger command enables you to get information about other users. The information
is stored in a hidden file called .plan. To find out about a user type finger
(email_address) for example, finger reeves@pangea.usask.ca.
Most studies show that the mortality rate from fingering is low.
-
Change your password with passwd. Note, you must know your old
password, so tough luck for you people with friends who leave the room.
To change the name people see when they finger you, use chfn.
-
Putting information in the .plan file of your home directory causes that
information to be displayed when fingered. Make note, however, that in
most well managed systems your home directory must be executable. Use
the commands chmod 711 $HOME and chmod 644 .plan
for the process to be complete. See the manpage on chmod for more details
of these numbers.
-
The most commonly used mailers (and mail readers) are: mail,
and pine. Mail is the standard boring mail reader and sender.
Pine is a graphical mailer. Pine is the recommended mail reader.
-
The most commonly used editors are: vi, pico,
emacs, and some sites have joe, nedit,
and others. vi is the de facto standard editor, and you will find it on
every UNIX. It is complex, albeit powerful. If you ever get stuck in vi,
just remember to ":q!". Pico is a graphical editor, and it comes from the
pine mailer. It is very cheesy, and suited towards new users. Emacs is
a (over)powerful editor, and it does it ALL - you can edit files, read mail,
play games, and learn how to bake cookies with emacs. Nedit is an easy-to-use
editor that requires X-Windows and the Motif libraries.
-
- for .Z files, use uncompress file.Z.
- for .gz files, use gunzip file.gz or gzip -d file.gz.
- for .lzh files, use lharc x file.lzh.
- for .zip files, use unzip file.zip.
Note that some systems may not have lharc or unzip.
-
Tar is a sticky black mess not unlike the "tar" archiving utility. Archives are
collections of files in a single file.
- To see what's in a .tar archive, use tar tvf file.tar
- To extract the files from a .tar archive, use tar xvf file.tar
- To make a tarfile, tar cvf tarfile.tar (files)
- To make a tarfile on tape, tar cvf $TAPE (files)
-
The answer used to be, just ask archie. Archie is a huge database of files collected from all sorts of ftp sites. Now the answer is to use a web browser (like Netscape) to search for the application.
-
GNU software can be searched for using archie, but since many sites
carry such software, you are advised to go to the "official" (and fastest)
site for GNU software: ftp://ftp.gnu.org
-
You may get many X programs right from the source, the X Consortium: ftp://ftp.x.org
-
The find command is used on the Unix command line for searching your
local filesystem (or those mounted by NFS). Find is a very complex command
with many commandline switches. It is far too complex to be explained fully
here. A simple example and explanation for searching for a file of a certain
name is:
find / -name 'myfile.txt' -print
The above will search all subdirectories of the root (/) directory for
the file by the name of myfile.txt. All files by that name will be printed.
There are many other things you can do; and wildcard matching is permitted.
See the manpage for more details.
There is also a command, 'where', that will search your PATH string for
a command. You can use this command, such as where chmod to find
the location of the program chmod.
-
Files ending in .c are C programs. They can be compiled using either
cc or gcc. We recommend gcc (the GNU C compiler). However, when you
download source files, you usually get a whole bunch of them at once,
accompanied by a "Makefile". All you have to do is type make
and it will compile the files for you. ALWAYS read the supplied README
file first, if it is there!!
-
The commands fg, bg, and the control sequence control-Z (^Z) are used for
UNIX job control. If you are currently using a program, ^Z will suspend it
and return you to your shell. You can find out what jobs you are running
by typing jobs. To make a program run in the background, type
bg %# where # is the number of the job listed in jobs.
The fg command returns the process to the foreground. This sounds much
more complex than it really is. Read the manpage on your shell (csh, tcsh,
and bash are common) for more info. Also check out the manpages to
kill and ps.