Permalink
Fetching contributors…
Cannot retrieve contributors at this time
760 lines (578 sloc) 22.3 KB

Ogden Area Linux User Group

Linux Basics

Presenter:Seth House
Date: 2009-04-28

Linux History

The Unix philosophy:

The use of plain text for storing data; a hierarchical file system; treating devices and certain types of inter-process communication as files; and the use of a large number of software tools, small programs that can be strung together through a command line interpreter using pipes, as opposed to using a single monolithic program that includes all of the same functionality.

http://en.wikipedia.org/wiki/Unix

The Berkeley Software Distribution, or Berkeley Unix, shared the initial codebase and design with the original AT&T UNIX. They started releasing non-AT&T code as open source and ran afoul of AT&T lawyers. The lawsuit was settled in 1994, largely in BSD’s favor, but the delay slowed BSD adoption and prompted the creation of Linux.

GNU began with the goal of making a free software operating system. It also nearly used the BSD kernel, but was also delayed by the legal hassles.

Linux began as a desire to run a Unix-like OS on commodity hardware. Linus has stated that if either the GNU or 386BSD kernels were available at the time, he likely would not have written his own.

Unix
1969
BSD
1977
GNU Project
1984—GPL, Utilities & libraries
Linux
1991—Kernel

Linux Distributions

Early distributions:

Before the first Linux distributions, a would-be Linux user was required to be something of a Unix expert, not only knowing what libraries and executables were needed to successfully get the system to boot and run, but also important details concerning configuration and placement of files in the system.

http://en.wikipedia.org/wiki/Linux_distribution

Yggdrasil last shipped in 1995.

Slackware was based on SLS, which was not well-maintained. It is the oldest distribution that is still maintained. Slackware 1.0 came on 24 floppy disks and was built on top of Linux kernel version 0.99pl11-alpha. Once the most popular distribution with an install-base probably around 80%, it’s popularity sharply declined in 1995 with the release of RedHat.

SUSE is the oldest existing commercial distribution.

Modern distributions are usually Debian, Gentoo, RPM, or Slackware-based. Others do exist, however.

  • H J Lu’s “Boot-root”, MCC Interim Linux, TAMU, SLS
  • 1992—Yggdrasil, the first CD-ROM based distribution
  • 1993-07—Slackware
  • 1993-08—Debian
  • 1994—SUSE
  • 1995—RedHat
  • 1998—Mandriva
  • 2004—Ubuntu

Distro: Fedora

Red Hat:

Red Hat sponsors the Fedora Project, a community-supported open-source project which aims to promote the rapid progress of free and open-source software and content.

[…]

Red Hat went public on August 11, 1999, the eighth-biggest first-day gain in the history of Wall Street.

[…]

In 2002, Red Hat introduced the first enterprise-class Linux operating system: Red Hat Advanced Server, later re-named Red Hat Enterprise Linux (RHEL). Dell, IBM, HP and Oracle Corporation announced their support of the platform.

http://en.wikipedia.org/wiki/Red_Hat

If you need enterprise-level features such as Oracle support or SELinux security, RHEL is the industry standard.

RPM has built-in intrusion detection. Easy to create custom repo with createrepo.

Some of the system-config tools are available in Ubuntu.

system-config-authentication system-config-boot system-config-date system-config-firewall system-config-firewall-tui system-config-keyboard system-config-language system-config-lvm system-config-network system-config-network-cmd system-config-network-gui system-config-network-tui system-config-printer system-config-printer-applet system-config-rootpassword system-config-selinux system-config-services system-config-time system-config-users system-control-network system-install-packages

Community-run base for Red Hat Enterprise Linux.

  • RPM-based
  • “yum” package manager
  • Anaconda installer (NFS, FTP, HTTP, CDROM, & HDD)
  • system-config-* tools
    • system-config-samba
    • system-config-printer

Distro: OpenSUSE

“The other” enterprise-level distribution from our own Novel in Provo. Has AppArmor security, although SELinux is arguably replacing it.

“The other” enterprise-level distribution.

  • RPM-based
  • “yast” package manager

Distro: Ubuntu & Debian

Debian supports four different kernels and 15 architectures.

Arguably the best package manager.

Debian has a strong reputation for stability.

Ubuntu has a strong reputation for usability and ease-of-installation. Ubuntu is a Zulu word meaning “humanity to others”. The Ubuntu philosophy is “I am what I am because of who we all are.” It was forked from Debian with the goal of more frequently updated system. Ubuntu has stayed fairly close to Debian’s philosophy of free (as in freedom) software with the exception of some proprietary hardware drivers and contributes back to Debian.

  • “apt” package manager
  • Stability
  • Usability

Distro: Slackware & Arch

  • “slackbuilds” / “pacman” package manager
  • BSD-like
  • Simple & vanilla

Distro: KDE vs. GNOME

The creator of KDE was troubled that no applications on Linux looked, felt, or worked alike. He proposed the formation of not only a set of applications, but rather a desktop environment, in which users could expect things to look, feel, and work consistently.

KDE is an umbrella project for many standalone applications and smaller projects that are based on KDE technology. These include KOffice, KDevelop, Amarok, K3b.

Members of the GNU project were concerned with KDE’s dependence on the then non-free Qt widget toolkit. It became open source in 1998.

The GNOME project puts heavy emphasis on simplicity, usability, and making things “just work”. During the v2.0 rewrite, many settings were deemed to be of little or no value to the majority of users and were removed. For instance, the preferences section of the Panel were reduced from a dialog of six tabs to one with two tabs.

  • 1996—KDE
  • 1997—GNOME

Installation

Install straight from Windows with Wubi

http://wubi-installer.org/ http://twit.tv/floss63

Installation: Partitioning

This will be quick since Aaron is presenting on this next month.

Purposes:

  • Separation of the operating system files from user files
  • Having an area for operating system virtual memory swapping/paging
  • Use of multi booting setups,
  • Protecting or isolating files, to make it easier to recover a corrupted file system or operating system installation

A PC hard disk is divided into at most four, and at least one, primary partitions. One of these can also be an extended partition. A primary partition contains one file system.

A hard disk may contain only one extended partition; which can then be sub-divided into logical drives.

Swap space (paging). With kernel 2.6 swap files are just as fast as partitions.

A note about Windows partitions. Windows expects to be on the primary master partition and will not work otherwise.

  • Primary partitions, 4 max
  • Extended partitions, 1 max, subdivided into logical drives
  • Resizing partitions (non-destructively)
  • Swap partition
  • Home partition (for easy upgraes)
  • Windows partition caveat

Installation: File System

A big effort in 1996 was started, along with the BSDs, to create a uniform file system hierarchy for Unix called the File System Hierarchy Standard (FHS). Most distributions, even those that participated in the formation of the standard, do not completely conform to the standard.

/bin
Essential command binaries that need to be available in single user mode; for all users.
/boot
Boot loader files, e.g., kernels, initrd; often a separate partition.
/dev
Essential devices, e.g., /dev/null.
/etc
System-wide configuration files.
/home
Users' home directories, containing saved files, personal settings, etc.; often a separate partition.
/lib
Libraries essential for the binaries in /bin/ and /sbin/.
/media
Mount points for removable media such as CD-ROMs.
/mnt
Temporarily mounted filesystems.
/proc
Virtual filesystem documenting kernel and process status as text files, e.g., uptime, network.
/root
Home directory for the root user.
/sbin
Essential system binaries, not for all users.
/srv
Site-specific data which is served by the system.
/tmp
Temporary files. Often not preserved between system reboots.
/usr
Secondary hierarchy for user data; contains the majority of user utilities and applications.
/usr/bin
Non-essential command binaries (not needed in single user mode); for all users.
/usr/sbin
Non-essential system binaries; not for all users.
/usr/X11R6
X Window System, Version 11, Release 6.
/usr/local
Tertiary hierarchy for local data, specific to this host.
/var
Variable files—files whose content is expected to continually change during normal operation of the system—such as logs, spool files, and temporary e-mail files. Sometimes a separate partition.
/var/lib
State information. Persistent data modified by programs as they run, e.g., databases, packaging system metadata, etc.
/var/lock
Lock files. Files keeping track of resources currently in use.
/var/log
Log files. Various logs.
/var/spool
Spool for tasks waiting to be processed, e.g., print queues and unread mail.
/var/tmp/
Temporary files to be preserved between reboots.
/         /usr/           /opt
/bin          bin         /var/
/boot         include         lib
/dev          lib             lock
/etc/         sbin            log
    X11       share           mail
/home         src             run
/lib          X11R6           spool
/media        local/          tmp
/mnt              bin
/proc             include
/root             lib
/sbin             sbin
/srv              share
/tmp              src

Post-Install: Graphics

  • Binary vs. Open Source Drivers
  • glxinfo | grep direct
  • dmseg | tail
  • Xorg.0.log

Post-Install: Wireless

  • ifconfig -a
  • iwconfig

Terminal Basics

In Unix, everything, including your hardware devices, is a file.

cat /dev/input/mice or hexdump /dev/input/mice

Small, specific, programs are chained together to produce complex results.

stdin
Standard Input
stdout
Standard Ouput
stderr
Standard Error
  • Everything is a file.
  • 40+ years of plain text.
  • stdin, stdout, stderr

Terminal Basics: First Steps

find / -name *pdf find /home -user joe find /var/spool -mtime +60 find . -perm /u+w,g+w

  • ls
  • cd
  • pwd
  • mkdir
  • rm
  • cp
  • mv
  • touch
  • find

Terminal Basics: Viewing Files

  • less
  • head
  • tail
  • cat
  • grep

Terminal Basics: File Permissions

  • ls -l
  • chmod
  • chown
  • chgrp
  • sudo
  • su

Terminal Basics: Text Files

cut -d":" -f1 /etc/passwd cut -d":" -f7 /etc/passwd | uniq paste -d", " fileone filetwo

  • sort
  • uniq
  • cut
  • tr
  • paste
  • fmt
  • wc
  • sed
  • awk

Terminal Basics: Combining Utilities

  • |
  • <
  • >
  • >>
  • -

Terminal Basics: Misc

  • basename
  • dirname
  • uname
  • nice
  • uptime
  • who

Servers

Running a headless workstation.

ssh!

http://ebox-platform.com/ http://twit.tv/floss62

Closing