2_intro to linux

Upload: waseed

Post on 05-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 2_Intro to Linux

    1/32

  • 7/31/2019 2_Intro to Linux

    2/32

    UNIX OS implemented by Ken Thompson andDennis Ritchie in 1969 and first released in

    1970.

    UNIX is one of the most popular operating

    systems worldwide because of its largesupport base and distribution.

    It was originally developed as a multitasking

    system for minicomputers and mainframes.

    Most versions of UNIX for personal computersare quite expensive and cumbersome.

    Ken Thompson& Dennis RitchiCreator of Unix

  • 7/31/2019 2_Intro to Linux

    3/32

    In 1983, Richard Stallman started the GNU project

    with the goal of creating a free UNIX-like operating

    system.

    In October 1985 he founded the Free Software

    Foundation (FSF).

    As part of this work, he wrote the GNU General

    Public License (GPL).

    By the early 1990s there was almost enough

    available software to create a full operating system.

    However, the GNU kernel, called Hurd, failed to

    attract enough attention from developers leaving

    GNU incomplete.

    Richard Stallman

    Founder of FSF

  • 7/31/2019 2_Intro to Linux

    4/32

    MINIX, a Unix-like system was released byAndrew S. Tanenbaum in 1987 intended to teach

    his students the inner workings of a real

    operating system.

    While source code for the system was available,modification and redistribution were restricted.

    MINIX's 16-bit design was not well adapted to

    the 32-bit features of the increasingly cheap and

    popular Intel 386 architecture for personalcomputers.

    Andrew S. TanenbaumUS-born Dutch professor

  • 7/31/2019 2_Intro to Linux

    5/32

    The History of Linux began in 1991 with thecommencement of a personal project by a Finnish

    student, Linus Torvalds, to create a new operating

    system kernel.

    Lack of a widely adopted, free kernel provided theimpetus for Torvalds's starting his project.

    Torvalds announced in 1996 that there would be a

    mascot for Linux, a penguin. This was due the fact

    when they were about to select the mascot,

    Torvalds was bitten by a littlepenguin on a visit to

    the National Zoo & Aquarium, Canberra, Australia.

    Linus Torvalds

    Founder of Linux Kernel

  • 7/31/2019 2_Intro to Linux

    6/32

    Linux is an operating system that is freely distributed under the terms ofthe GNU Public License.

    It behaves like Unix, but does not come from the same source code

    base. Linux is available in both source code and binary form.

    Linux offers standard Unix features, such as multiuser support,

    multitasking, networking and many more.

    The complete Linux operating system consists of the Linux core, or

    kernel, combined with the utilities and applications required for a fully

    functional operating system.

  • 7/31/2019 2_Intro to Linux

    7/32

    Linux Architecture

    Linux consists oflayers of software that are required to provide the nice

    graphical user interface to interact with. The main components of a

    standard Linux distribution are:

    The Linux kernel

    Runs all the time.

    Manage what programs are allowed to run and how they are run.

    Users never interact with the kernel directly.

    The CLI (command line interpreter) or Shell

    Provides a means for communicating and controlling the machine.

    The command shell running on top of the kernel provides the

    minimum working system that users can interact with.

    Often when Linux is used as a server, the Shell will suffice, and the

    higher layers of the system need not be loaded.

  • 7/31/2019 2_Intro to Linux

    8/32

    The X Window System The software that provides the basic graphical interface capabilities.

    Often referred to as X11.

    The Window Manager Makes the windows look and behave the way we see them.

    Manage the buttons frames and basic window behaviors.

    The Desktop Provides a rich user experience on top of the facilities provided by

    the window manager.

    Two main Desktop options available KDE and Gnome.

    Linux Architecture

  • 7/31/2019 2_Intro to Linux

    9/32

    Linux Architecture

  • 7/31/2019 2_Intro to Linux

    10/32

    The Linux kernel can be further divided into three gross levels:

    System Call Interface

    Resides at the top of the kernel.

    Implements the basic functions such as read and write.

    Kernel Code The architecture-independent kernel code.

    Common to all of the processor architectures supported by Linux.

    Architecture-dependent Code

    Forms a BSP (Board Support Package).

    This code serves as the processor and platform-specific code for the

    given architecture.

    Linux Architecture

  • 7/31/2019 2_Intro to Linux

    11/32

    Linux Architecture

  • 7/31/2019 2_Intro to Linux

    12/32

    Why such layers and how it differs from Windows?

    Each of these layers of software communicate with each other in well

    defined standard ways.

    So as long as the software used in each of the layers sticks to the rules,

    different programs can be used in any layer.

    This is one of the key strengths of Linux; through careful choice of

    software in each layer, its possible to create a Linux system that will runon a pocket sized mobile phones.

    Windows has a kernel which is similar in function to the Linux kernel,

    but the layers above that are not so well defined.

    You can't choose a different window manager that better suits yourpurposes.

    You can't even write an improvement you need, since its all proprietary

    there's no way to know how all the programs inside Windows talk to

    each other.

  • 7/31/2019 2_Intro to Linux

    13/32

    Another noticeable differences between Linux and Windows is the

    directory structure.

    Linux File Structure

    /

    /bin /sbin /etc /proc /var/dev

    /tmp /usr /home /lib /opt/boot

    /media /srv/mnt

  • 7/31/2019 2_Intro to Linux

    14/32

    Linux File Structure

    / Root

    Every single file and directory starts from the root directory.

    Only root user has write privilege under this directory.

    Please note that /root is root users home directory, which is not

    same as /.

    /bin User Binaries

    Contains binary executables.

    Common linux commands that need to be used in single-user

    modes are located under this directory.

    Commands used by all the users of the system are located here.

    For example: ps, ls, ping, grep, cp.

  • 7/31/2019 2_Intro to Linux

    15/32

    Linux File Structure

    /sbin System Binaries

    Just like /bin, /sbin also contains binary executables.

    But, the linux commands located under this directory are used

    typically by system aministrator, for system maintenance purpose.

    For example: iptables, reboot, fdisk, ifconfig, swapon.

    /etc Configuration Files

    Contains configuration files required by all programs.

    This also contains startup and shutdown shell scripts used to

    start/stop individual programs.

    For example: /etc/resolv.conf, /etc/logrotate.conf

  • 7/31/2019 2_Intro to Linux

    16/32

    Linux File Structure

    /dev Device Files

    Contains device files.

    These include terminal devices, usb, or any device attached to the

    system.

    For example: /dev/tty1, /dev/usbmon0

    /proc Process Information

    Contains information about running system processes.

    For example: /proc/{pid} directory contains information about the

    process with that particular pid.

    This is a virtual filesystem with text information about system

    resources. For example: /proc/uptime

  • 7/31/2019 2_Intro to Linux

    17/32

    Linux File Structure

    /var Variable Files

    Content of the files that are expected to grow can be found under

    this directory.

    This includes system log files (/var/log); packages and database

    files (/var/lib); emails (/var/mail); print queues (/var/spool); lock

    files (/var/lock); temp files needed across reboots (/var/tmp), etc.

    /tmp Temporary Files

    Directory that contains temporary files created by system andusers.

    Files under this directory are deleted when system is rebooted.

  • 7/31/2019 2_Intro to Linux

    18/32

    Linux File Structure

    /usr User Programs

    Contains binaries, libraries, documentation, and source-code for

    second level programs.

    /usr/bin contains binary files for user programs. If you cant find a

    user binary under /bin, look under /usr/bin.

    /usr/sbin contains binary files for system administrators. If you

    cant find a system binary under /sbin, look under /usr/sbin.

    /usr/lib contains libraries for /usr/bin and /usr/sbin

    /usr/local contains users programs that you install from source. Forexample, when you install apache from source, it goes under

    /usr/local/apache2

  • 7/31/2019 2_Intro to Linux

    19/32

    Linux File Structure

    /home Home Directories

    Home directories for all users to store their personal files.

    For example: /home/john, /home/rasel.

    /boot

    Boot Loader Files

    Contains boot loader related files.

    Kernel initrd, vmlinux, grub files are located under /boot.

    For example: initrd.img-2.6.32-24-generic, vmlinuz-2.6.32-24-

    generic.

  • 7/31/2019 2_Intro to Linux

    20/32

    Linux File Structure

    /lib System Libraries

    Contains library files that supports the binaries located under /bin

    and /sbin.

    Library filenames are either ld* or lib*.so.*

    For example: ld-2.11.1.so, libncurses.so.5.7.

    /opt Optional add-on Applications

    Contains add-on applications from individual vendors.

    Add-on applications should be installed under either /opt/ or /opt/

    sub-directory./mnt Mount Directory

    Temporary mount directory where sysadmins can mount

    filesystems.

  • 7/31/2019 2_Intro to Linux

    21/32

    Linux File Structure

    /media Removable Media Devices

    Temporary mount directory for removable devices.

    For examples, /media/cdrom for CD-ROM; /media/floppy for floppy

    drives; /media/cdrecorder for CD writer.

    /srv Service Data

    srv stands for service.

    Contains server specific services related data.

    For example, /srv/cvs contains CVS related data.

  • 7/31/2019 2_Intro to Linux

    22/32

    A complete multitasking, multiuser operating system. This means that

    many users can log into and run programs on the same machine

    simultaneously.

    Developed with source code portability in mind, and its easy to find

    commonly used features that are shared by more than one platform.

    All of the source code including the kernel, device drivers, libraries, user

    programs, and development tools, is freely distributable.

    Supports various file systems for storing data, like the ext2, ext3, vfat,etc. file system, which was developed specifically for Linux.

    Software Features

  • 7/31/2019 2_Intro to Linux

    23/32

    A shell is a program which reads and executes commands from the user.

    In addition, many shells provide features like job control, managing

    several processes at once, input and output redirection, and a

    command language for writing shell scripts. Many types of shells are

    available for Linux like :

    C SHell (csh).

    Bourne SHell (sh).

    GNU Bourne Again Shell (bash).

    Korn Shell (ksh).

    The standard compiler for Linux is GNU gcc, which is an advanced,

    modern compiler that supports C++.

    Software Features

  • 7/31/2019 2_Intro to Linux

    24/32

    Provides a complete implementation of TCP/IP networking software.This includes:

    Device drivers for many popular Ethernet cards.

    SLIP (Serial Line Internet Protocol).

    PPP (Point-to-Point Protocol).

    PLIP (Parallel Line Internet Protocol).

    NFS (Network File System).

    The complete range of TCP/IP clients and services is also supported,

    which includes FTP, telnet, NNTP, and SMTP.

    Software Features

  • 7/31/2019 2_Intro to Linux

    25/32

    The X Window System allows users to have multiple terminal windows

    on the screen at once, each having a different login session.

    The X Window System was originally developed at the Massachusetts

    Institute of Technology and is freely distributable.

    Linux includes web server software as well as web browsers. The most

    common server is Apache. Thousands of Linux systems run Apache on

    the Internet today, including the Linux Resources site,

    www.linuxresources.com.

    Several relational databases are available for Linux, including Postgres,

    Ingres, MySQL, etc.

    Software Features

  • 7/31/2019 2_Intro to Linux

    26/32

    Linux is covered by the GNU General Public License, or GNUGPL.

    Software covered by the GPL may be distributed and used free of

    charge. Free, in this sense, refers to distribution, not cost.

    Originally, Linus Torvalds released Linux under a license more restrictive

    than the GPL, which allowed the software to be freely distributed andmodified, but without any profit making.

    On the other hand, the GPL allows people to sell and profit from free

    software, but does not allow them to restrict anothers right to

    distribute the software in any way.

    GPL-licensed software is also not shareware. Generally, shareware is

    owned and copyrighted by an author who requires users to send in

    money for its use.

    Copyright Issues

  • 7/31/2019 2_Intro to Linux

    27/32

    The Linux model of software development discards the entire concept of

    organized development, source code control systems, structured bugreporting, and statistical quality control.

    Linux is, and likely always will be, a hackers operating system.

    The thrust behind Linux development is not to release perfect, bug-freecode: it is to develop a free UNIX implementation.

    There is no single organization responsible for developing Linux. Anyone

    with enough know-how has the opportunity to help develop and debug

    the kernel, port new software, write documentation, and help new

    users.

    The system itself is designed using an open-ended, feature-minded

    approach.

    Philosophy of Linux

  • 7/31/2019 2_Intro to Linux

    28/32

    Anyone who has a new feature or software application generally makes it

    available in an alpha versionthat is, a test version, for those brave userswho want to hash out problems in the initial code.

    Linux software is generally released as a distribution, a set of

    prepackaged software which comprises an entire system.

    many software distributions are available which include everything

    necessary to install and run a complete system.

    There is no single, standard distributionthere are many, and each has

    its own advantages and disadvantages.

    Philosophy of Linux

  • 7/31/2019 2_Intro to Linux

    29/32

    Debian-based

    Knoppix-based

    Ubuntu-based

    Official distributions

    Contributed distributions

    Third-party distributions Gentoo-based

    Pacman-based

    RPM-based

    Fedora-based

    Red Hat Enterprise Linux-based

    Mandriva Linux-based

    Slackware-based

    Slax-based

    Linux Distributions

  • 7/31/2019 2_Intro to Linux

    30/32

    aLinux Alpine Linux ALT Linux Annvix

    Arch Linux Ark Linux Asianux BLAG Linux and GNUBodhi Linux Caixa Mgica CentOS CRUX

    Damn Small Linux Debian deepOfix Mail Server DeLi Linux

    Devil-Linux dyne:bolic EasyPeasy Edubuntu

    Elive EnGarde Secure Linux Fedora Finnix

    Foresight Linux Freespire Frugalware GentoogNewSense gnuLinEx GoboLinux Gobuntu

    Impi Linux Kanotix Knoppix KnoppMyth

    Kubuntu Kurumin Linux Mint Lunar Linux

    Mageia MintPPC Musix GNU/Linux Slax

    NimbleX NUbuntu openSUSE Pardus

    Parsix PCLinuxOS Platypux Puppy Linux

    Sabayon Linux Scientific Linux sidux Slackware

    Network Security

    Toolkit

    SliTaz GNU/Linux Source Mage

    GNU/Linux

    Symphony OS

    Linux Distributions

  • 7/31/2019 2_Intro to Linux

    31/32

    Red Hat (Enterprise) Linux is probably the largest commercial Linux

    vendor. Focus on stability and long term support. Red Hat sponsors acommunity version (Fedora) which undergoes a more rapid development

    cycle.

    KNOPPIX The first Live CD version. The OS can be booted from, and run

    completely off the CD. KNOPPIX is based on Debian Linux. Many vendors

    now offer Live versions. No installation necessary.

    Ubuntu based on Debian Linux. Ubuntu claims to be most popular

    desktop version. Many applications and excellent updatemechanism

    contribute to its success. Revenue is created by selling technical support.

    Puppy This distribution is small enough to be loaded entirely in RAM.

    This frees up the CD/DVD drive for other uses. Configuration can be saved

    to a file between reboots.

    Recovery Is Possible (RIP) good for data recovery of corrupted media or

    backup. Tools such as ddrescue allows copying media sector by sector.

    Can repair NTFS or FAT partitions.31

    Linux Distributions

  • 7/31/2019 2_Intro to Linux

    32/32

    Red Hat Enterprise Linux (RHEL) is a Linux-based operating system developed by Red

    Hat and targeted toward the commercial market.

    Red Hat Enterprise Linux is released in server versions for x86, x86-64, Itanium, PowerPC

    and IBM System z, and desktop versions for x86 and x86-64.

    Red Hat Enterprise Linux is often abbreviated to RHEL, although this is not an official

    designation.

    While Red Hat uses strict trademark rules to restrict free re-distribution of their officially

    supported versions of Red Hat Enterprise Linux, Red Hat freely provides the source code

    for the distribution's software, both for free software whose license requires such

    publishing and open source software where this is not mandatory.

    As a result, several distributors have created re-branded and/or community-supported

    re-builds of Red Hat Enterprise Linux that can legally be made available, without official

    support from Red Hat.

    CentOS aims to provide 100% binary compatibility to Redhat Linux.