Introduction to Linux
O. S. Adewale, fsca
Department of Computer Sciences
The Federal University of Technology
Akure, Nigeria
[email protected]
Outlines
➲ Operating Systems
➲ What is Linux, and Who Created it?
➲ GNU and the GPL
➲ Unix/GNU, What is the Difference?
➲ POSIX Compliance
➲ Other POSIX Operating Systems
➲ Uses of Linux
➲ Advantages and Disadvantages
Operating Systems
➲ An operating system is
a program that acts as
an interface between
the user and the
computer hardware and
controls the execution
of all kinds of programs.
Types of operating Systems
➲ Tasks
● Uni tasking
● Multi tasking
➲ Users
● Single User
● Multi User
➲ Processing
● Uni processing
● Multi processing
➲ Timesharing
Functions of Operating Systems
➲ Memory Management
➲ Processor Management
➲ Device Management
➲ File Management
➲ Security
➲ Control over system performance
➲ Job accounting
➲ Error detecting aids
➲ Coordination between other software and
users
Memory Management
➲ Main memory provides a fast storage that
can be accessed directly by the CPU
➲ An operating system does the following
activities for memory management:
● Keeps tracks of primary memory, that is, what
part of it are in use by whom, what part are not
in use.
● In multiprogramming, the OS decides which
process will get memory when and how much.
● Allocates the memory when a process requests
it to do so.
● De-allocates the memory when a process no
longer needs it or has been terminated.
Processor Management
➲ In multiprogramming environment, the OS
decides which process gets the processor
when and for how much time. This function
is called process scheduling.
➲ An operating system does the following
activities for processor management:
● Keeps tracks of processor and status of
process. The program responsible for this task is
known as traffic controller.
● Allocates the processor (CPU) to a process.
● De-allocates processor when a process is no
longer required.
Device Management
➲ An operating system manages device
communication via their respective drivers.
It does the following activities for device
management:
● Keeps tracks of all devices. Program
responsible for this task is known as the I/O
controller.
● Decides which process gets the device when
and for how much time.
● Allocates the device in the efficient way.
● De-allocates devices.
File management
➲ A file system is normally organised into
directories for easy navigation and usage.
These directories may contain files and
other directions.
➲ An operating system does the following
activities for file management:
● Keeps track of information, location, uses, status
etc. The collective facilities are often known as
file system.
● Decides who gets the resources.
● Allocates the resources.
● De-allocates the resources.
Other Important Activities of OS
➲ Following are some of the important activities that
an Operating System performs:
● Security − By means of password and similar other
techniques, it prevents unauthorised access to programs
and data.
● Control over system performance − Recording delays
between request for a service and response from the
system.
● Job accounting − Keeping track of time and resources
used by various jobs and users.
● Error detecting aids − Production of dumps, traces,
error messages, and other debugging and error
detecting aids.
● Coordination between other software and users −
Coordination and assignment of compilers, interpreters,
assemblers and other software to the various users of
the computer systems.
Before Linux
➲ In 80’s, Microsoft’s DOS was the dominated
OS for PC
➲ Apple MAC was better, but expensive
➲ UNIX was much better, but much, much more
expensive. Only for minicomputer for
commercial applications
➲ People was looking for a UNIX based system,
which is cheaper and can run on PC
➲ Both DOS, MAC and UNIX were proprietary,
that is, the source code of their kernel is
protected
➲ No modification is possible without paying
high license fees
Beginning of Linux
➲ A famous professor Andrew Tanenbaum
developed Minix, a simplified version of UNIX that
runs on PC
➲ Minix is for class teaching only. No intention for
commercial use
➲ In Sept 1991, Linus Torvalds, a second year
student of Computer Science at the University of
Helsinki, developed the preliminary kernel of
Linux, known as Linux version 0.0.1
Message from Prof. Andrew Tanenbaum
➲ " I still maintain the point that designing a
monolithic kernel in 1991 is a fundamental error.
Be thankful you are not my student. You would
not get a high grade for such a design)“
(Andrew Tanenbaum to Linus Torvalds)
➲ Soon more than a hundred people joined
the Linux camp. Then thousands. Then
hundreds of thousands
➲ It was licensed under GNU General Public
License, thus ensuring that the source
codes will be free for all to copy, study and
to change.
Linux Today
➲ Linux has been used for many computing
platforms
● PC, PDA, Supercomputer,…
➲ Not only character user interface but graphical
user interface is available
➲ Commercial vendors moved in Linux itself to
provide freely distributed code. They make their
money by compiling up various software and
gathering them in a distributable format
● Red Hat, Slackware, etc
What is Linux
➲ Linux is a UNIX clone
● It can run on 32 bit and 64 bit hardware
● Linux is a true multitasking environment
● Fully capable of taking advantage of multiple
processors
● Can address up to 64 GB of RAM
● Partial POSIX Compliance
Linux – Free Software
➲ Free software, as defined by the FSF (Free Software
Foundation), is a "matter of liberty, not price." To
qualify as free software by FSF standards, you must
be able to:
● Run the program for any purpose you want to, rather than
be restricted in what you can use it for.
● View the program's source code.
● Study the program's source code and modify it if you need
to.
● Share the program with others.
● Improve the program and release those improvements so
that others can use them.
Penguin Power
➲ Linux is free
● Anyone can download and compile the source
● The code can be modified by anyone provided
the modifications are released to the community
History
➲ The history of Linux began with Unix in
1969
● Unix was created at Bell Labs with the goals:
● Simplicity
● Recycleable code
● Written in C as opposed to assembly
➲ Development started in 1991
● Linus Torvalds wanted to create a free
implementation of UNIX
● By 1993 there were 12000 Linux users
● Today Linux rivals UNIX in stability and
scalability
Features of Linux
➲ Portable − Portability means software can works
on different types of hardware in same way. Linux
kernel and application programs supports their
installation on any kind of hardware platform.
➲ Open Source − Linux source code is freely
available and it is community based development
project. Multiple teams work in collaboration to
enhance the capability of Linux operating system
and it is continuously evolving.
➲ Multiuser − Linux is a multiuser system means
multiple users can access system resources like
memory/RAM/application programs at same time.
➲ Multiprogramming − Linux is a
multiprogramming system means multiple
applications can run at same time.
Features of Linux cont...
➲ Hierarchical File System − Linux provides a
standard file structure in which system files/ user
files are arranged.
➲ Shell − Linux provides a special interpreter
program which can be used to execute commands
of the operating system. It can be used to do
various types of operations, call application
programs. etc.
➲ Security − Linux provides user security using
authentication features like password protection/
controlled access to specific files/ encryption of
data.
Architecture of Linux OS
•
Hardware layer − Hardware
consists of all peripheral devices
(RAM/ HDD/ CPU etc).
•
Kernel − It is the core
Component of Operating System,
interacts directly with hardware,
provides low level services to
upper layer components.
•
Shell − An interface to kernel,
hiding complexity of kernel's
functions from users. The shell
takes commands from the user
and executes kernel's functions.
• Utilities − Utility programs that
provide the user most of the
functionalities of an operating
systems.
The Kernel
➲ Linux is not an Operating System
➲ Linux is a kernel
➲ A kernel is a program that allocates and controls
hardware resources in a system
➲ Linux Distributions use the Linux kernel
together with the GNU Operating System
The Linux Kernel
➲ The Linux kernel is currently maintained by
Linus Torvalds and a few hundred other
developers
➲ Releases are numbered in a very ordered
fashion.
● Major.minor.patchlevel
● Odd minor numbers are development kernels
● Thus
● 2.4.20 stable kernel
● 2.5.67 development kernel
Design
➲ The Linux kernel has a monolithic design
➲ The other approach is the microkernel
design
➲ Both have their upsides and downsides
● Monolithic kernels
● Easier to build and design
● Generally faster
● More recompiles
● Less object oriented
● Micro kernels
● Considered safer
● Easier to develop drivers for
● Only recompile for upgrades
● Generally slower
● Much harder to build and design
Linux Operating System
Other *NIX Kernels
➲ The BSD kernel
● This is the kernel used by the open source
BSD's
● FreeBSD, OpenBSD, NetBSD
● It is neither GNU nor GPL
➲ The GNU HURD
● Hird of Unix Replacing Daemons
● Hurd of Interfaces Representing Death
● The world's first doubly recursive acronym
● Micro kernel
● Not very functional
GNU Project
➲ Established in 1984 by Richard Stallman,
who believes that software should be free
from restrictions against copying or
modification in order to make better and
efficient computer programs
➲ GNU is a recursive acronym for “GNU's Not
Unix”
● Aim at developing a complete Unix-like operating system
which is free for copying and modification
● Companies make their money by maintaining and
distributing the software, e.g. optimally packaging the
software with different tools (Redhat, Slackware,
Mandrake, SuSE, etc)
● GNU has released GNU C Compiler, GNU Emacs, bash
to mention a few
What is the GNU GPL?
➲ The GNU General Public License
● Ensures that GNU software stays free
● This is done through Copy Lefting
● Any modification to GPL software is required to
be released to the public
● Linux is released under the GPL
● Due to its restrictive nature the GPL has recently
come under fire
● http://www.linux.org.uk/GPL.html
Does the GPL Matter?
➲ Depends on your point of view
● Not as important for users
● Very important for developers
● Any GPL code that is incorporated into a program
makes the entire program GPL
● No closed source software can use any GPL software
So Unix Costs Money and
GNU/Linux is Free
➲ Essentially this is the case
● Both have the goals of POSIX compliance
● Commercial UNIXes are in general closer
● This is generally in implementation, not in use
➲ Commercial UNIXes generally perform
better in large systems
● But even this is difference is shrinking
➲ The biggest difference is that UNIX is
trademarked and must be commericial—not
free
POSIX? Another Operating
System?
➲ POSIX, its yet another acronym
● Portable Operating System Interface
➲ POSIX is a set of specifications
● Describes how the operating system should behave
● Both to the user, and to other programs
➲ POSIX was created to combat the plethora of
UNIXes that popped up in the 1980, all of
which had a different look and feel
➲ The Open Group controls the UNIX
trademark
● They also release their own UNIX specification
➲ The POSIX specification has been merged with
the Open Group's UNIX specification
Other POSIX OSes
➲ IBM AIX
➲ Sun Solaris
➲ SGI IRIX
➲ HP HP-UX
➲ Compaq TRU64 UNIX
So Why Should I Use Linux?
➲ As a server platform
● few other operating systems can match Linux in:
● Performance
● Price
● Stability
➲ For Developers
● Resources:
● Linux has a tremendous number of tools available for
developers. And they are all free.
➲ For the Desktop
● It's fun
Advantages
➲ Linux is free
● Can't say that enough
● It's great for poor college students
➲ Learning Linux means learning UNIX, and
UNIX is the largest server platform in the
world
➲ Community
● The Linux community is very active and helpful
● This makes support very rapid
But it's hard to learn
➲ Linux is much harder than Windows
➲ It's harder to use than Windows
➲ It lacks all those great automated
installation tools
➲ You have to manually configure hardware
➲ There is lots of hardware out there that just
won't run in Linux
So You Are Ready to Take the
Plunge
➲ What do I need to know?
● Not all distributions are the same
● Linux From Scratch is a bad starting place
● Internet Resources
● www.linux.org
● www.tldp.org
● www.justlinux.org
● www.desktoplinux.org
➲ What distribution should I start with?
● Redhat
● Mandrake
● Suse
● Ubuntu
● Live CDs
Linux Distributions
➲ Red Hat Linux: One of the original Linux distribution.
● The commercial, non-free version is Red Hat Enterprise Linux, which is aimed at
big companies using Linux servers and desktops in a big way.
● Free version: Fedora Project.
➲ Debian GNU/Linux: A free software distribution. Popular for use on
servers. However, Debian is not what many would consider a
distribution for beginners, as it's not designed with ease of use in
mind.
➲ SuSE Linux: SuSE was recently purchased by Novell. This
distribution is primarily available for pay because it contains many
commercial programs, although there's a stripped-down free version
that you can download.
➲ Mandrake Linux: Mandrake is perhaps strongest on the desktop.
Originally based off of Red Hat Linux.
➲ Gentoo Linux: Gentoo is a specialty distribution meant for
programmers.
Some Linux Basics
➲ File System
● Linux is much more hierarchal than Windows
● Everything starts at the root
● /
● boot - contains the kernel and system map
● bin --contains the basic system binaries
● dev - all the device entries
● etc - can not think of any other place to put it/system
configuration files
● home - where all the users live
● lib - system libraries
● mnt - place to mount filesystems
● proc - system information
● root - the root user's home
● sbin - system binaries
● usr - where user accessible programs go
● var - logs and such
Basics cont...
➲ /bin: Important Linux commands available to the
average user.
➲ /boot: The files necessary for the system to boot. Not
all Linux distributions use this one.
➲ /dev: All device drivers. Device drivers are the files
that your Linux system uses to talk to your hardware.
For example, there's a file in the /dev directory for
your particular make and model of monitor, and all of
your Linux computer's communications with the
monitor go through that file.
➲ /etc: System configuration files.
➲ /home: Every user except root gets her own folder in
here, named for her login account. So, the user who
logs in with adewale has the directory /home/adewale,
where all of his personal files are kept.
➲ /lib: System libraries. Libraries are just bunches of
programming code that the programs on your system
use to get things done.
Basics cont...
➲ mnt: Mount points. When you temporarily load the
contents of a CD-ROM or USB drive, you typically use a
special name under /mnt. For example, many
distributions (including Fedora) come, by default, with
the directory /mnt/cdrom, which is where your CD-ROM
drive's contents are made accessible.
➲ /root: The root user's home directory.
➲ /sbin: Essential commands that are only for the system
administrator.
➲ /tmp: Temporary files and storage space. Don't put
anything in here that you want to keep. Most Linux
distributions (including Fedora) are set up to delete any
file that's been in this directory longer than three days.
➲ /usr: Programs and data that can be shared across
many systems and don't need to be changed.
➲ /var: Data that changes constantly (log files that contain
information about what's happening on your system,
data on its way to the printer, and so on).
Basics cont...
➲ You can see what your home directory is
called by entering:
● pwd (print current working directory)
Basics cont...
➲ CLI
● The command line interface
● Bash is the most common shell
● The CLI in Linux is quite useable
➲ Navigation
● ls - lists files and directories
● cd - changes directories
● rm - removes files
● Navigation switches
● Most programs have options that you can pass to
them via switches, for ex. ls -h gives you all the
options that ls can take and what they do
whoami
ls pwd
Linux Shell Bash, Tcsh, Zsh
Kernel
➲ Shell interprets the command and request
service from kernel
➲ Similar DOS but DOS has only one set of
interface while Linux can select different
shell
● Bourne Again shell (Bash), TC shell (Tcsh), Z
shell (Zsh)
➲ Different shell has similar but different
functionality
➲ Bash is the default for Linux
➲ Graphical user interface of Linux is in fact
an application program work on the shell
6 Runlevels
➲ Level 0
● Halt
➲ Level 1
● Single User mode
➲ Level 2
● Reserved
➲ Level 3
● Full Mulituser
➲ Level 4
● Reserved
➲ Level 5
● Xwindows
➲ Level 6
● Reboot
XWindows
➲ Linux Graphical Environment
➲ Invoked via the startx command
● Two major environments
● KDE
● Gnome
● The difference is primarily in philosophy
● Redhat tries to erase the differences with Bluecurve
➲ Does everything Windows does and more
Office Software
➲ Word Processor
➲ Spreadsheet
➲ Presentation
➲ Database Application
Others Software
➲ Text Editor
● Emacs
● VI editor
● gEdit
● kWrite
● TextPad
➲ Email
● MS Outlook
● There are many e-mail applications for GNU/Linux.
However, one of the full-featured suites including a
calendar, to do list and e-mail is Ximian Evolution.
Ximian Evolution is a powerful and flexible personal
information manager up to par with Outlook. Again, it's
free, and the interface is designed to look similar to
Outlook so the learning curve is low.
➲ Browser
● Mozilla/Firefox/Sea Monkey
Other Software cont...
➲ Audio Player: The XMMS (X Multimedia
System), which is used to play digital sound
files
➲ CD Player: The default CD player
➲ Sound Juicer CD Ripper: Burn your own
CDs
➲ Messaging Client: GAIM supports AIM,
MSN, ICQ, and many other popular IM
networks
➲ gFTP: Useful for grabbing files through FTP
(File Transfer Protocol)
Networking Services
➲ UUCP
● Unix to Unix copy program
● A batch-processing/spooling system
● Typically used between systems with dial-up telephone
lines or direct serial lines
➲ TCP/IP
● rlogin, rcp, rsh, ssh, telnet, ftp
● ping, netstat, traceroute
➲ Network File System (NFS)
● Allowing transparent file access over TCP/IP networks
among computers, including Unix, Linux and MS
Windows machines.
➲ IPX/SPX
● Netware clients can log in Unix servers via Novell
network.
➲ LAN Manager Client
● allowing the sharing of files with MS Windows machines
(via Network Neighbourhood).
● allowing the sharing of printers across machines.
SSH, Telnet
➲ SSH (Secure Shell) is a terminal emulation
protocol that allows a user to connect to a
remote host via an encrypted and secure
link.
➲ Telnet is a terminal emulation protocol that
lets a user log in remotely to other
computers on the Internet; it has a
command line interface.
Pattern Matching
➲ grep – GNU Regular Expression Processor
➲ Finds the words/patterns matching with the
search and displays the line containing the
patterns.
➲ Search is limited to a file
Linux Online Documentation
➲ Unix/Linux commands are documented on
line in the man pages.
➲ The man command provides online access
to the system's reference pages
● man, pinfo, info (man <<cmd name>>)
A Few Good Distributions
➲ Redhat
➲ Mandrake
➲ Suse
➲ Lycoris
➲ Gentoo
➲ Knoppix
Hat's off
➲ Redhat
● Pros
● Easy install
● Tons of graphical tools
● Great hardware support
● One of the most mature distros
● Cons
● It's slow
● Their stock kernel is somewhat bloated
● Installs files in non-standard directories
● Not customizeable
Drako
➲ Mandrake
● Based on Redhat
● Modified to suit desktop systems more than
Redhat
● Supports that funky DVD Decoder Card you
have to use
● More on the edge than Redhat
● Uses a modified kernel
Tame the Lizard
➲ Suse
● Pros
● Avoids much of the bloat of Redhat and Mandrake
● Great hardware support
● The easiest Linux installation I have ever had
● Cons
● Still hard to customize
Perfection
➲ Gentoo
● Pros
● Builds Linux from scratch, optimizing for the
architecture of your PC
● Blazing speed
● Highly customizeable
● User Forums are a great place for support
● Runs Quake and Unreal Tournament 2003 out of the
box
● Has a kernel specifically modified for gamers
● Cons
● Can be overwhelming
● Takes a long time to build
● Do not trip over the power cable while it is building
Knoppix
➲ Self contained
➲ Can boot almost any pc that supports cdrom
booting
➲ Settings can be stored locally or on USB
pen drive
➲ Great to learn on
➲ Does not require resizing partions or wiping
drives
Thanking you