A Hands On Guide - Wayne State University

Transcription

Introduction to LinuxA Hands on GuideMachtelt Garrels, Garrels.be tille wants no spam at garrels dot be

Introduction to Linux: A Hands on Guideby Machtelt GarrelsPublication date 20080606Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Machtelt Garrels

Table of ContentsIntroduction . xiWhy this guide? . xiWho should read this book? . xiNew versions and availability . xiRevision History . xiiContributions . xiiiFeedback . xiiiCopyright information . xiiiWhat do you need? . xivConventions used in this document . xivOrganization of this document . xv1. What is Linux? . 1History . 1UNIX . 1Linus and Linux . 2Current application of Linux systems . 3The user interface . 3Is Linux difficult? . 3Linux for non-experienced users . 4Does Linux have a future? . 4Open Source . 4Ten years of experience at your service . 5Properties of Linux . 6Linux Pros . 6Linux Cons . 7Linux Flavors . 8Linux and GNU . 8GNU/Linux . 9Which distribution should I install? . 9Summary . 10Exercises . 112. Quickstart . 12Logging in, activating the user interface and logging out . 12Introduction . 12Graphical mode . 12Text mode . 14Absolute basics . 14The commands . 14General remarks . 15Using Bash features . 16Getting help . 17Be warned . 17The man pages . 17More info . 19Summary . 23Exercises . 24Connecting and disconnecting . 24Passwords . 24Directories . 25Files . 25Getting help . 26iii

Introduction to Linux3. About files and the file system .General overview of the Linux file system .Files .About partitioning .More file system layout .Orientation in the file system .The path .Absolute and relative paths .The most important files and directories .The most important configuration files .The most common devices .The most common variable files .Manipulating files .Viewing file properties .Creating and deleting files and directories .Finding files .More ways to view file content .Linking files .File security .Access rights: Linux's first line of defense .The tools .Summary .Exercises .Partitions .Paths .Tour of the system .Manipulating files .File permissions .4. Processes .Processes inside out .Multi-user and multi-tasking .Process types .Process attributes .Displaying process information .Life and death of a process .SUID and SGID .Boot process, Init and shutdown .Introduction .The boot process .GRUB features .Init .Init run levels .Shutdown .Managing processes .Work for the system admin .How long does it take? .Performance .Load .Can I do anything as a user? .Scheduling processes .Use that idle time! .The sleep command .The at command .Cron and crontab 38888888889

Introduction to LinuxSummary . 91Exercises . 92General . 92Booting, init etc. . 93Scheduling . 935. I/O redirection . 94Simple redirections . 94What are standard input and standard output? . 94The redirection operators . 94Advanced redirection features . 97Use of file descriptors . 97Examples . 98Filters . 99More about grep . 99Filtering output . 99Summary . 100Exercises . 1016. Text editors . 103Text editors . 103Why should I use an editor? . 103Which editor should I use? . 103Using the Vim editor . 104Two modes . 104Basic commands . 105The easy way . 106Linux in the office . 106History . 106Suites and programs . 107Remarks . 107Summary . 107Exercises . 1087. Home sweet /home . 109General good housekeeping . 109Introduction . 109Make space . 109Your text environment . 112Environment variables . 112Shell setup files . 115A typical set of setup files . 115The Bash prompt . 118Shell scripts . 120The graphical environment . 122Introduction . 122The X Window System . 123X server configuration . 124Region specific settings . 125Keyboard setup . 125Fonts . 125Date and time zone . 126Language . 126Country-specific Information . 127Installing new software . 127General . 127Package formats . 127v

Introduction to LinuxAutomating package management and updates . 130Upgrading your kernel . 131Installing extra packages from the installation CDs . 132Summary . 133Exercises . 134Shell environment . 134Graphical environment . 1358. Printers and printing .

Many people still believe that learning Linux is difficult, or that only experts can understand how a Linux system works. Though there is a lot of free documentation available, the documentation is widely scattered on the Web, and often confusing, since it is usually ori