sed
and
awk
. In Chapter 8, only cover operating system
installation. In Chapter 13, the instructor may wish to skip material on open source instal-
lation and/or gcc.
The following topics from the chapters are considered optional. Omitting them will not
reduce the readability of the remainder of the text.
• Chapter 1: the entire chapter (although a brief review of the Gnome GUI would be
useful)
• Chapter 2: interpreters
• Chapter 3: Linux file system structure (if you are also going to cover Chapter 10);
secondary storage devices; compression algorithms
• Chapter 5: all material excluding vi
• Chapter 6: sed and awk
• Chapter 8: the Linux kernel; virtual memory, SELinux
• Chapter 12: writing your own network scripts
• Chapter 13: the gcc compiler; the Open Source Movement
• Chapter 14: disaster planning and recovery
• Chapter 15: the entire chapter
This textbook primarily describes Red Hat version 6 and CentOS version 2.6. As this
textbook is being prepared for publication, new versions of Linux are being prepared by
both Red Hat (version 7) and CentOS (version 2.7). Although most of these changes do not
impact the material in this textbook, there are a few instances where version 7 (and 2.7)
will differ from what is described here. See the author’s website at www.nku.edu/~foxr/
linux/ which describes the significant changes and provides additional text to replace any
outdated text in this book.
xxv
Author
R
ichard Fox
is a professor of computer science at Northern Kentucky University
(NKU). He regularly teaches courses in both computer science (artificial intelligence,
computer systems, data structures, computer architecture, concepts of programming lan-
guages) and computer information technology (IT fundamentals, Unix/Linux, web server
administration). Dr. Fox, who has been at NKU since 2001, is the current chair of NKU’s
University Curriculum Committee. Prior to NKU, Dr. Fox taught for nine years at the
University of Texas—Pan American. He has received two Teaching Excellence awards,
from the University of Texas—Pan American in 2000 and from NKU in 2012.
Dr. Fox received a PhD in computer and information sciences from Ohio State
University in 1992. He also has an MS in computer and information sciences from
Ohio State (1988) and a BS in computer science from University of Missouri Rolla (now
Missouri University of Science and Technology) from 1986.
Dr. Fox published an introductory IT textbook in 2013 (also from CRC Press/Taylor &
Francis). He is also author or coauthor of over 45 peer-reviewed research articles primarily
in the area of artificial intelligence. He is currently working on another textbook with a
colleague at NKU on Internet infrastructure.
Richard Fox grew up in St. Louis, Missouri and now lives in Cincinnati, Ohio. He is a big
science fiction fan and progressive rock fan. As you will see in reading this text, his favorite
composer is Frank Zappa.
1
C h a p t e r
1
Introduction to Linux
T
his chapter’s learning objects are
• To understand the appeal behind the Linux operating system
• To understand what operating systems are and the types of things they do for the user
• To know how to navigate using the two popular Linux GUIs (graphical user interfaces)
• To understand what an interpreter is and does
• To understand virtual machines (VMs)
• To understand the history of Unix and Linux
• To understand the basic components of a computer system
1.1 WHY LINUX?
If you have this textbook, then you are interested in Linux (or your teacher is making you
use this book). And if you have this textbook, then you are interested in computers and
have had some experience in using computers in the past. So why should you be inter-
ested in Linux? If you look around our society, you primarily see people using Windows,
Macintosh OS X, Linux, and Unix in one form or another. Below, we see an estimated
breakdown of the popularity of these operating systems as used on desktop computers.
*
• Microsoft Windows: 90.8%
• Primarily Windows 7 but also Vista, NT, XP, and Windows 8
• Macintosh: 7.6%
• Mac OS X
*
Estimates vary by source. These come from New Applications as of November 2013. However, they can be inaccurate
because there is little reporting on actual operating system usage other than what is tracked by sales of desktop units and
the OS initially installed there.
2
◾
Linux with Operating System Concepts
• Linux or Unix: 1.6%
• There are numerous distributions or “flavors” of Linux and Unix
If we expand beyond desktop computers, we can find other operating systems which
run on mainframe computers, minicomputers, servers, and supercomputers. Some of the
operating systems for mainframe/minicomputer/server/supercomputer are hardware-
specific such as IBM System i (initially AS/200) for IBM Power Systems. This harkens
back to earlier days of operating systems when each operating system was specific to one
platform of hardware (e.g., IBM 360/370 mainframes). For mobile devices, there are still
a wide variety of systems but the most popular two are iOS (a subset of Mac OS X) and
Android (Linux-based).
With such a small market share for Linux/Unix, why should we bother to learn it?
Certainly for your career you will want to learn about the more popular operating system(s).
Well, there are several reasons to learn Linux/Unix.
First, the Macintosh operating system (Mac OS X) runs on top of a Unix operating
system (based on the Mach Unix kernel). Thus, the real market share is larger than it first
appears. Additionally, many of the handheld computing devices run a version of Linux
(e.g., Google Android). In fact, estimates are that Android-based devices make up at least
20% of the handheld device market. There are other hardware devices that also run Linux
or Unix such as firewalls, routers, and WiFi access points. So Linux, Unix, Mac OS X, and
the operating systems of many handheld devices comes to more than 15% of the total oper-
ating system usage.
*
Second, and more significant, is the fact that a majority of the servers that run on the
Internet run Linux or Unix. In 2011, a survey of the top 1 million web servers indicated
that nearly 2/3s ran Unix/Linux while slightly more than 1/3 ran Microsoft Windows. The
usage of Unix/Linux is not limited to web servers as the platform is popular for file servers,
mail servers, database servers, and domain name system servers.
That still might not explain why you should study Linux. So consider the following points.
• Open source (free)—The intention of open source software is to make the source code
available. This gives programmers the ability to add to, enhance or alter the code and
make the new code available. It is not just the Linux operating system that is open
source but most of its application software. Enhancements can help secure software
so that it has fewer security holes. Additions to the software provide new features.
Alterations to software give users choices as to which version they want to use. Linux,
and all open source software, continues to grow at an impressive rate as more and
more individuals and groups of programmers contribute. As a side effect, most open
source software is also freely available. This is not true of all versions of Linux (e.g.,
Red Hat Enterprise Linux is a commercial product) but it is true of most versions.
*
Other sources of operating system statistics aside from Net Applications include NetMarketShare, StatCounter,
ComputerWorld, AT Internet, canalys, Gartner, zdnet, and Linux Journal. See, for instance, marketshare.hitslink.com.
Introduction to Linux
◾
3
• Greater control—Although Windows permits a DOS shell so that the user can enter
commands, the DOS commands are limited in scope. In Linux/Unix, the command
line is where the power comes from. As a user, you can specify a wide variety of
options in the commands entered via the command line and thus control the operat-
ing system with greater precision. Many users become frustrated with the Windows
approach where most control is removed from the users’ hands. The Windows
approach is one that helps the naive user who is blissfully unaware of how the operat-
ing system works. In Linux, the user has the option to use the GUI but for those who
want to be able to more directly control the operating system rather than be con-
trolled by the operating system, the command line gives that level of access.
• Learning about operating systems—As stated in the last bullet point, Windows helps
shelter users from the details of what the operating system is doing. This is fine for
most users who are using a computer to accomplish some set of tasks (or perhaps
are being entertained). But some users will desire to learn more about the computer.
With the command line interface (CLI) in Unix/Linux, you have no choice but to
learn because that is the only way to know how to use the command line. And learn-
ing is fairly easy with the types of support available (e.g., man pages).
• It’s cool—well, that depends upon who you are.
In this textbook, we primarily concentrate on the CentOS 6 version of Red Hat
Linux.
*
As will be discussed later in this chapter, there are hundreds of Linux distribu-
tions available. One reason to emphasize CentOS is that it is a typical version of Red
Hat, which itself is one of the most popular versions of Linux. Additionally, CentOS is
free, easy to install, and requires less resources to run efficiently and effectively than
other operating systems.
1.2 OPERATING SYSTEMS
The earliest computers had no operating system. Instead, the programmer had to define
the code that would launch their program, input the program from storage or punch cards
and load it in memory, execute the program and in doing so, retrieve input data from stor-
age or punch cards, and send output to storage. That is, the programmer was required to
implement all aspects of running the program. At that time, only one program would run
at a time and it would run through to completion at which point another programmer
could use the computer.
By the late 1950s, the process of running programs had become more complicated.
Programs were often being written in
Do'stlaringiz bilan baham: |