basic_unix_tutorial.pdf

(270 KB) Pobierz
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
A broad description of the UNIX operating system.
General methods of accessing UNIX computers.
Gaining access to your UNIX account.
How to enter UNIX commands.
Storing and manipulating files.
How to manage input and output.
Creating processing pipelines.
124528586.012.png 124528586.013.png
Managing processes.
More on managing processes.
Creating and editing text files with the emacs editor.
The environment under which shell commands and programs run.
Personalizing your UNIX shell environment.
Tips and tricks to enhance your efficiency with the command line interface.
A closer look at UNIX files and directories.
I DAHO S TATE U NIVERSITY
Revised: February 5, 1997
Author: Jonathan Byrd
124528586.014.png 124528586.015.png 124528586.001.png
Section 1: What Is Unix?
Unix is an operating system . The job of an operating system is to orchestrate the various parts of the
computer -- the processor, the on-board memory, the disk drives, keyboards, video monitors, etc. --
to perform useful tasks. The operating system is the master controller of the computer, the glue that
holds together all the components of the system, including the administrators, programmers, and
users. When you want the computer to do something for you, like start a program, copy a file, or
display the contents of a directory, it is the operating system that must perform those tasks for you.
More than anything else, the operating system gives the computer its recognizable characteristics. It
would be difficult to distinguish between two completely different computers, if they were running
the same operating system. Conversely, two identical computers, running different operating
systems, would appear completely different to the user.
Unix was created in the late 1960s, in an effort to provide a multiuser, multitasking system for use by
programmers. The philosophy behind the design of Unix was to provide simple, yet powerful
utilities that could be pieced together in a flexible manner to perform a wide variety of tasks.
The Unix operating system comprises three parts: The kernel, the standard utility programs, and the
system configuration files.
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.
The standard utility programs
These programs include simple utilities like cp, which copies files, and complex utilities, like the
shell that allows you to issue commands to the operating system.
The system configuration files
The system configuration files are read by the kernel, and some of the standard utilities. The Unix
kernel and the utilities are flexible programs, and certain aspects of their behavior can be controlled
by changing the standard configuration files. One example of a system configuration file is the
filesystem table "fstab" , which tells the kernel where to find all the files on the disk drives. Another
example is the system log configuration file "syslog.conf", which tells the kernel how to record the
various kinds of events and errors it may encounter.
124528586.002.png 124528586.003.png 124528586.004.png
Section 2: Accessing a Unix System
There are many ways that you can access a Unix system. If you want the fullest possible access to
the computer's commands and utilities, you must initiate a login session. The main mode of initiating
a login session to a Unix machine is through a terminal , which usually includes a keyboard, and a
video monitor.
When a terminal establishes a connection to the Unix system, the Unix kernel runs a process called a
tty to accept input from the terminal, and send output to the terminal. When the tty process is created,
it must be told the capabilities of the terminal, so it can correctly read from, and write to, the
terminal. If the tty process receives incorrect information about the terminal type, unexpected results
can occur.
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.
Network-based access modes
Unix computers were designed early in their history to be network-aware. The fact that Unix
computers were prevalent in academic and research environments led to their broad use in the
124528586.008.png 124528586.009.png 124528586.010.png 124528586.011.png
Zgłoś jeśli naruszono regulamin