contents · palimpsest: the gnome disk utility (fedora)78 using the kickstart configurator 82...
Post on 22-Aug-2020
0 Views
Preview:
TRANSCRIPT
xiiixiii
Contents
Preface xxxvii
Chapter 1: Welcome to Linux 1
The GNU–Linux Connection 2The History of GNU–Linux 2The Code Is Free 4Have Fun! 5
The Linux 2.6 Kernel 5The Heritage of Linux: UNIX 5What Is So Good About Linux? 6
Why Linux Is Popular with Hardware Companies and Developers 7Linux Is Portable 8Standards 8The C Programming Language 9
Overview of Linux 10Linux Has a Kernel Programming Interface 10Linux Can Support Many Users 10Linux Can Run Many Tasks 11Linux Provides a Secure Hierarchical Filesystem 11The Shell: Command Interpreter and Programming Language 12A Large Collection of Useful Utilities 14Interprocess Communication 14System Administration 14
000.book Page xiii Thursday, January 21, 2010 2:29 PM
xiv Contents
Additional Features of Linux 14GUIs: Graphical User Interfaces 15(Inter)Networking Utilities 16Software Development 16
Conventions Used in This Book 16Chapter Summary 19Exercises 19
PART I Installing Fedora and Red Hat
Enterprise Linux 21
Chapter 2: Installation Overview 23
The Desktop Live CD and the Install DVD 24Planning the Installation 24
Considerations 25Requirements 25Processor Architecture 26Interfaces: Installer and Installed System 28Which Are You Installing: Fedora or Red Hat Enterprise Linux? 28Upgrading an Existing Fedora/RHEL System Versus Installing a Fresh Copy 29Setting Up the Hard Disk 30RAID 37LVM: Logical Volume Manager 38
The Installation Process 39The Medium: Where Is the Source Data? 40Downloading a CD/DVD (FEDORA) 41
The Easy Way to Download a CD ISO Image File 41Finding a Mirror Site to Download From 42Using BitTorrent to Download a CD/DVD ISO Image File 44
Checking and Burning the CD/DVD 45Checking the File 45Burning the CD/DVD 46
Rescue Selection of the Install DVD 46Gathering Information About the System 46Finding the Installation Manual 47More Information 48Chapter Summary 48Exercises 49Advanced Exercises 49
Chapter 3: Step-by-Step Installation 51
Running a Fedora Live Session 52Booting the System 52
000.book Page xiv Thursday, January 21, 2010 2:29 PM
Contents xv
Installing Fedora/RHEL 55Installing from a Live Session 55Installing/Upgrading from the Install DVD 55The Anaconda Installer 57Firstboot: When You Reboot 66Initializing Databases and Updating the System 67
Installation Tasks 68Modifying Boot Parameters (Options) 68Partitioning the Disk 71LVs: Logical Volumes 73Partitions 76palimpsest: The GNOME Disk Utility (FEDORA) 78Using the Kickstart Configurator 82Setting Up a Dual-Boot System 82
The X Window System 84gnome-display-properties: Configures the Display 84More Information 85
Chapter Summary 85Exercises 85Advanced Exercises 86
PART II Getting Started with Fedora and
Red Hat Enterprise Linux 87
Chapter 4: Introduction to Fedora and Red Hat
Enterprise Linux 89
Curbing Your Power (Superuser/root Privileges) 90A Tour of the Fedora/RHEL Desktop 90
Logging In on the System 91Introduction 92Launching Programs from the Desktop 93Switching Workspaces 95Setting Personal Preferences 96Mouse Preferences 97Working with Windows 98Using Nautilus to Work with Files 98The Update Applet 104Changing Appearance (Themes) 105Desktop Effects (FEDORA) 108Session Management 108Getting Help 108Feel Free to Experiment 109Logging Out 109
000.book Page xv Thursday, January 21, 2010 2:29 PM
xvi Contents
Getting the Most Out of the Desktop 109GNOME Desktop Terminology 110Opening Files 110Panels 111The Main Menu 114Windows 115The Object Context Menu 119
Updating, Installing, and Removing Software Packages 122Updates (FEDORA) 122Add/Remove Software 123
Where to Find Documentation 124GNOME Help Browser 125man: Displays the System Manual 125apropos: Searches for a Keyword 127info: Displays Information About Utilities 127The ––help Option 130HOWTOs: Finding Out How Things Work 130Getting Help with the System 131
More About Logging In 132The Login Screen 133What to Do If You Cannot Log In 134Logging In Remotely: Terminal Emulators, ssh, and Dial-Up Connections 135Logging In from a Terminal (Emulator) 135Changing Your Password 136Using Virtual Consoles 137
Working from the Command Line 138Correcting Mistakes 138Repeating/Editing Command Lines 140
Controlling Windows: Advanced Operations 141Changing the Input Focus 141Changing the Resolution of the Display 142The Window Manager 142
Chapter Summary 143Exercises 144Advanced Exercises 145
Chapter 5: The Linux Utilities 147
Special Characters 148Basic Utilities 149
ls: Lists the Names of Files 149cat: Displays a Text File 149rm: Deletes a File 150less Is more: Display a Text File One Screen at a Time 150hostname: Displays the System Name 151
000.book Page xvi Thursday, January 21, 2010 2:29 PM
Contents xvii
Working with Files 151cp: Copies a File 151mv: Changes the Name of a File 152lpr: Prints a File 153grep: Searches for a String 153head: Displays the Beginning of a File 154tail: Displays the End of a File 154sort: Displays a File in Order 155uniq: Removes Duplicate Lines from a File 156diff: Compares Two Files 157file: Tests the Contents of a File 157
| (Pipe): Communicates Between Processes 158Four More Utilities 159
echo: Displays Text 159date: Displays the Time and Date 159script: Records a Shell Session 160unix2dos: Converts Linux and Macintosh Files to Windows Format 161
Compressing and Archiving Files 161bzip2: Compresses a File 162bunzip2 and bzcat: Decompress a File 162gzip: Compresses a File 163tar: Packs and Unpacks Archives 163
Locating Commands 166which and whereis: Locate a Utility 166apropos: Searches for a Keyword 167locate: Searches for a File 168
Obtaining User and System Information 168who: Lists Users on the System 169finger: Lists Users on the System 169w: Lists Users on the System 171
Communicating with Other Users 172write: Sends a Message 172mesg: Denies or Accepts Messages 173
Email 174Tutorial: Creating and Editing a File Using vim 174
Starting vim 175Command and Input Modes 176Entering Text 177Getting Help 178Ending the Editing Session 181The compatible Parameter 181
Chapter Summary 181Exercises 184Advanced Exercises 185
000.book Page xvii Thursday, January 21, 2010 2:29 PM
xviii Contents
Chapter 6: The Linux Filesystem 187
The Hierarchical Filesystem 188Directory Files and Ordinary Files 188
Filenames 189The Working Directory 192Your Home Directory 192
Pathnames 193Absolute Pathnames 193Relative Pathnames 194
Directory Commands 195mkdir: Creates a Directory 195Important Standard Directories and Files 198
Working with Directories 200rmdir: Deletes a Directory 200Using Pathnames 201mv, cp: Move or Copy Files 201mv: Moves a Directory 202
Access Permissions 202ls –l: Displays Permissions 203chmod: Changes Access Permissions 204Setuid and Setgid Permissions 205Directory Access Permissions 206
ACLs: Access Control Lists 207Enabling ACLs 208Working with Access Rules 208Setting Default Rules for a Directory 211
Links 212Hard Links 214Symbolic Links 216rm: Removes a Link 218
Chapter Summary 218Exercises 220Advanced Exercises 222
Chapter 7: The Shell 223
The Command Line 224Syntax 224Processing the Command Line 227Executing the Command Line 229Editing the Command Line 229
000.book Page xviii Thursday, January 21, 2010 2:29 PM
Contents xix
Standard Input and Standard Output 230The Screen as a File 230The Keyboard and Screen as Standard Input and Standard Output 231Redirection 232Pipes 238
Running a Program in the Background 241Filename Generation/Pathname Expansion 243
The ? Special Character 243The * Special Character 244The [ ] Special Characters 245
Builtins 247Chapter Summary 248
Utilities and Builtins Introduced in This Chapter 249Exercises 249Advanced Exercises 251
PART III Digging into Fedora and Red Hat
Enterprise Linux 253
Chapter 8: Linux GUIs: X and GNOME 255
X Window System 256Using X 258Desktop Environments/Managers 263
The Nautilus File Browser Window 264The View Pane 265The Side Pane 265Control Bars 266Menubar 267
The Nautilus Spatial View 270GNOME Utilities 272
Font Preferences (FEDORA) 272Pick a Font Window (FEDORA) 272Pick a Color Window 273Run Application Window 274Searching for Files 274GNOME Terminal Emulator/Shell 275
Chapter Summary 276Exercises 277Advanced Exercises 277
000.book Page xix Thursday, January 21, 2010 2:29 PM
xx Contents
Chapter 9: The Bourne Again Shell 279
Background 280
Shell Basics 281Startup Files 281Commands That Are Symbols 284Redirecting Standard Error 284Writing a Simple Shell Script 286Separating and Grouping Commands 290Job Control 294Manipulating the Directory Stack 296
Parameters and Variables 299User-Created Variables 300Variable Attributes 303Keyword Variables 305
Special Characters 313
Processes 314Process Structure 314Process Identification 314Executing a Command 316
History 316Variables That Control History 316Reexecuting and Editing Commands 318The Readline Library 326
Aliases 332Single Versus Double Quotation Marks in Aliases 333Examples of Aliases 334
Functions 335
Controlling bash Features and Options 338Command-Line Options 338Shell Features 338
Processing the Command Line 342History Expansion 342Alias Substitution 342Parsing and Scanning the Command Line 342Command-Line Expansion 343
Chapter Summary 351
Exercises 353
Advanced Exercises 355
000.book Page xx Thursday, January 21, 2010 2:29 PM
Contents xxi
Chapter 10: Networking and the Internet 357
Types of Networks and How They Work 359Broadcast Networks 360Point-to-Point Networks 360Switched Networks 360LAN: Local Area Network 361WAN: Wide Area Network 362Internetworking Through Gateways and Routers 362Network Protocols 365Host Address 367CIDR: Classless Inter-Domain Routing 371Hostnames 372
Communicate Over a Network 374finger: Displays Information About Remote Users 374Sending Mail to a Remote User 375Mailing List Servers 376
Network Utilities 376Trusted Hosts 376OpenSSH Tools 377telnet: Logs In on a Remote System 377ftp: Transfers Files Over a Network 379ping: Tests a Network Connection 379traceroute: Traces a Route Over the Internet 380host and dig: Query Internet Nameservers 382jwhois: Looks Up Information About an Internet Site 382
Distributed Computing 383The Client/Server Model 384DNS: Domain Name Service 385Ports 387NIS: Network Information Service 387NFS: Network Filesystem 387Internet Services 388Proxy Servers 391RPC Network Services 391
Usenet 392WWW: World Wide Web 395
URL: Uniform Resource Locator 396Browsers 396Search Engines 396
Chapter Summary 397Exercises 398Advanced Exercises 399
000.book Page xxi Thursday, January 21, 2010 2:29 PM
xxii Contents
PART IV System Administration 401
Chapter 11: System Administration: Core Concepts 403
System Administrator and Superuser 405System Administration Tools 407
Rescue Mode 411Avoiding a Trojan Horse 412Getting Help 413
SELinux 414More Information 415config: The SELinux Configuration File 415getenforce, setenforce, and sestatus: Work with SELinux 416Setting the Targeted Policy with system-config-selinux 416
The Upstart Event-Based init Daemon (FEDORA) 417Definitions 418Jobs 420
System Operation 424Runlevels 424Booting the System 425Init Scripts: Start and Stop System Services 426Single-User Mode 430Going to Multiuser Mode 431Graphical Multiuser Mode 431Logging In 431Logging Out 433Bringing the System Down 433Crash 436
System Administration Utilities 436Fedora/RHEL Configuration Tools 437Command-Line Utilities 438
Setting Up a Server 441Standard Rules in Configuration Files 441rpcinfo: Displays Information About rpcbind 443The xinetd Superserver 445Securing a Server 447DHCP: Configures Hosts 451
nsswitch.conf: Which Service to Look at First 455How nsswitch.conf Works 455
PAM 458More Information 459Configuration Files, Module Types, and Control Flags 459Example 462Modifying the PAM Configuration 463
Chapter Summary 464Exercises 464Advanced Exercises 465
000.book Page xxii Thursday, January 21, 2010 2:29 PM
Contents xxiii
Chapter 12: Files, Directories, and Filesystems 467
Important Files and Directories 468File Types 480
Ordinary Files, Directories, Links, and Inodes 481Special Files 482
Filesystems 485mount: Mounts a Filesystem 487umount: Unmounts a Filesystem 490fstab: Keeps Track of Filesystems 490fsck: Checks Filesystem Integrity 492tune2fs: Changes Filesystem Parameters 492RAID Filesystem 494
Chapter Summary 495Exercises 495Advanced Exercises 496
Chapter 13: Downloading and Installing Software 497
yum: Keeps the System Up-to-Date 498Configuring yum 498Using yum to Update, Install, and Remove Packages 500yum Groups 503Other yum Commands 504yum-updatesd: Runs yum Automatically 504Upgrading a System with yum 505Downloading rpm Package Files with yumdownloader 505
Adding and Removing Software Packages 505pirut: Adds and Removes Software Packages (RHEL) 505
BitTorrent 507rpm: Red Hat Package Manager 510
Querying Packages and Files 511Installing, Upgrading, and Removing Packages 512Installing a Linux Kernel Binary 512
Installing Non-rpm Software 513The /opt and /usr/local Directories 513GNU Configure and Build System 513
Keeping Software Up-to-Date 515Bugs 515Errata 516Red Hat Network (RHEL) 516
wget: Downloads Files Noninteractively 517Chapter Summary 518Exercises 518Advanced Exercises 518
000.book Page xxiii Thursday, January 21, 2010 2:29 PM
xxiv Contents
Chapter 14: Printing with CUPS 519
Introduction 520Prerequisites 520More Information 521Notes 521
JumpStart I: Configuring a Local Printer 521system-config-printer: Configuring a Printer 522
Configuration Selections 522Setting Up a Remote Printer 524
JumpStart II: Setting Up a Local or Remote Printer Using the CUPS Web Interface 527Traditional UNIX Printing 530Configuring Printers 532
The CUPS Web Interface 532CUPS on the Command Line 533Sharing CUPS Printers 537
Printing from Windows 538Printing Using CUPS 538Printing Using Samba 539
Printing to Windows 540Chapter Summary 540Exercises 541Advanced Exercises 541
Chapter 15: Rebuilding the Linux Kernel 543
Preparing the Source Code 544Locating the Kernel Source Code 544Installing the Kernel Source Code 545
Read the Documentation 546Configuring and Compiling the Linux Kernel 547
Cleaning the Source Tree 547Configuring the Linux Kernel 547Compiling the Kernel 549Using Loadable Kernel Modules 549
Installing the Kernel and Associated Files 550Rebooting the System 550Boot Loader 551
grub: The Linux Loader 551dmesg: Displays Kernel Messages 553Chapter Summary 553Exercises 554Advanced Exercises 554
000.book Page xxiv Thursday, January 21, 2010 2:29 PM
Contents xxv
Chapter 16: Administration Tasks 555
Configuring User and Group Accounts 556system-config-users: Manages User Accounts 556useradd: Adds a User Account 557userdel: Removes a User Account 558groupadd: Adds a Group 558
Backing Up Files 558Choosing a Backup Medium 559Backup Utilities 560Performing a Simple Backup 562dump , restore: Back Up and Restore Filesystems 563
Scheduling Tasks 565crond and crontab: Schedule Routine Tasks 565at: Runs Occasional Tasks 565
System Reports 566vmstat: Reports Virtual Memory Statistics 566top: Lists Processes Using the Most Resources 567
parted: Reports on and Partitions a Hard Disk 568Keeping Users Informed 572Creating Problems 572
Failing to Perform Regular Backups 573Not Reading and Following Instructions 573Failing to Ask for Help When Instructions Are Not Clear 573Deleting or Mistyping a Critical File 573
Solving Problems 574Helping When a User Cannot Log In 574Speeding Up the System 575lsof: Finds Open Files 576Keeping a Machine Log 576Keeping the System Secure 577Log Files and Mail for root 577Monitoring Disk Usage 578logrotate: Manages Log Files 579Removing Unused Space from Directories 581Disk Quota System 582rsyslogd: Logs System Messages 582
MySQL 584More Information 585Terminology 585Syntax and Conventions 585Prerequisites 585Notes 586Jumpstart: Setting Up MySQL 586Options 587The .my.cnf Configuration File 587Working with MySQL 588
000.book Page xxv Thursday, January 21, 2010 2:29 PM
xxvi Contents
Chapter Summary 592Exercises 593Advanced Exercises 593
Chapter 17: Configuring and Monitoring a LAN 595
Setting Up the Hardware 596Connecting the Computers 596Gateways and Routers 597NIC: Network Interface Card 597
Configuring the Systems 598NetworkManager: Configures Network Connections 599
The NetworkManager Applet 599The Network Configuration Window (system-config-network) 601
Adding a Device 603Editing a Device 603Setting Up Networking for a Server 605
iwconfig: Configures a Wireless NIC 605Setting Up Servers 606Introduction to Cacti 607
Configuring SNMP 608Setting Up LAMP 608Enabling the Cacti Poller 611Configuring Cacti 611Basic Cacti Administration 612Setting Up a Remote Data Source 614
More Information 617Chapter Summary 617Exercises 618Advanced Exercises 618
PART V Using Clients and Setting Up
Servers 619
Chapter 18: OpenSSH: Secure Network
Communication 621
Introduction 622About OpenSSH 622
Files 622How OpenSSH Works 624More Information 624
000.book Page xxvi Thursday, January 21, 2010 2:29 PM
Contents xxvii
OpenSSH Clients 625Prerequisites 625JumpStart: Using ssh and scp 625Setup 626ssh: Connects to or Executes Commands on a Remote System 627scp: Copies Files from/to a Remote System 630sftp: A Secure FTP Client 631~/.ssh/config and /etc/ssh/ssh_config Configuration Files 631
sshd: OpenSSH Server 633Prerequisites 633Notes 633JumpStart: Starting the sshd Daemon 633Authorized Keys: Automatic Login 634Command-Line Options 636/etc/ssh/sshd_config Configuration File 636
Troubleshooting 637Tunneling/Port Forwarding 638Chapter Summary 641Exercises 641Advanced Exercises 642
Chapter 19: FTP: Transferring Files Across a
Network 643
Introduction 644More Information 645FTP Client 645
Prerequisites 645JumpStart: Downloading Files Using ftp 646Notes 649Anonymous FTP 649Automatic Login 649Binary Versus ASCII Transfer Mode 650ftp Specifics 650
FTP Server (vsftpd) 654Prerequisites 654Notes 654JumpStart: Starting a vsftpd Server 655Testing the Setup 655vsftpd.conf: The vsftpd Configuration File 656
Chapter Summary 666Exercises 667Advanced Exercises 667
000.book Page xxvii Thursday, January 21, 2010 2:29 PM
xxviii Contents
Chapter 20: sendmail: Setting Up Mail Clients, Servers,
and More 669
Introduction 670Prerequisites 671Notes 671More Information 672
JumpStart I: Configuring sendmail on a Client 672JumpStart II: Configuring sendmail on a Server 673How sendmail Works 674
Mail Logs 674Aliases and Forwarding 675Related Programs 676
Configuring sendmail 677The sendmail.mc and sendmail.cf Files 677Other Files in /etc/mail 680
Additional Email Tools 682SpamAssassin 682Configuring SpamAssassin 684Webmail 686Mailing Lists 688Setting Up an IMAP or POP3 Server 689
Authenticated Relaying 689Alternatives to sendmail 691Chapter Summary 692Exercises 692Advanced Exercises 693
Chapter 21: NIS and LDAP 695
Introduction to NIS 696How NIS Works 696
More Information 698Setting Up an NIS Client 699
Prerequisites 699Notes 699Step-by-Step Setup 699Testing the Setup 701yppasswd: Changes NIS Passwords 702
Setting Up an NIS Server 703Prerequisites 703Notes 704Step-by-Step Setup 704Testing 709yppasswdd: The NIS Password Update Daemon 709
000.book Page xxviii Thursday, January 21, 2010 2:29 PM
Contents xxix
LDAP 710More Information 712
Setting Up an LDAP Server 713Prerequisites 713Note 713Step-by-Step Setup 713Other Tools for Working with LDAP 720Evolution Mail 720Konqueror 722
Chapter Summary 723Exercises 724Advanced Exercises 724
Chapter 22: NFS: Sharing Filesystems 727
Introduction 728More Information 730Setting Up an NFS Client 730
Prerequisites 730JumpStart I: Mounting a Remote Directory Hierarchy 730mount: Mounts a Directory Hierarchy 732Improving Performance 734/etc/fstab: Mounts Directory Hierarchies Automatically 735
Setting Up an NFS Server 736Prerequisites 736Notes 736JumpStart II: Configuring an NFS Server Using system-config-nfs 737Exporting a Directory Hierarchy 738exportfs: Maintains the List of Exported Directory Hierarchies 742Testing the Server Setup 743
automount: Automatically Mounts Directory Hierarchies 744Chapter Summary 746Exercises 746Advanced Exercises 747
Chapter 23: Samba: Integrating Linux and Windows 749
Introduction 750About Samba 751
Prerequisites 751More Information 751Notes 751Samba Users, User Maps, and Passwords 752
JumpStart: Configuring a Samba Server Using system-config-samba 753swat: Configures a Samba Server 755
000.book Page xxix Thursday, January 21, 2010 2:29 PM
xxx Contents
Manually Configuring a Samba Server 759Parameters in the smbd.conf File 760The [homes] Share: Sharing Users’ Home Directories 765
Accessing Linux Shares from Windows 765Browsing Shares 765Mapping a Share 766
Accessing Windows Shares from Linux 766smbtree: Displays Windows Shares 766smbclient: Connects to Windows Shares 767Browsing Windows Networks 767Mounting Windows Shares 767
Troubleshooting 768Chapter Summary 770Exercises 771Advanced Exercises 771
Chapter 24: DNS/BIND: Tracking Domain Names and
Addresses 773
Introduction to DNS 774Nodes, Domains, and Subdomains 774Zones 776Queries 777Servers 778Resource Records 779DNS Query and Response 782Reverse Name Resolution 783
About DNS 785How DNS Works 785Prerequisites 785More Information 786Notes 786
JumpStart I: Setting Up a DNS Cache 787JumpStart II: Setting Up a Domain Using system-config-bind 789
Notes 789Using the BIND Configuration GUI Window 790Setting Up a Domain Server 791Adding Resource Records 792
Setting Up BIND 793named.conf: The named Configuration File 794Zone Files 796A DNS Cache 797DNS Glue Records 802TSIGs: Transaction Signatures 803Running BIND in a chroot Jail 804
000.book Page xxx Thursday, January 21, 2010 2:29 PM
Contents xxxi
Troubleshooting 805A Full-Functioned Nameserver 807A Slave Server 810A Split Horizon Server 811Chapter Summary 816Exercises 816Advanced Exercises 817
Chapter 25: iptables: Setting Up a Firewall 819
How iptables Works 820About iptables 822
More Information 822Prerequisites 823Notes 823
JumpStart: Building a Firewall Using system-config-firewall 824Anatomy of an iptables Command 825Building a Set of Rules 826
Commands 827Packet Match Criteria 828Display Criteria 828Match Extensions 829Targets 831Copying Rules to and from the Kernel 832
system-config-firewall: Generates a Set of Rules 833Sharing an Internet Connection Using NAT 835
Connecting Several Clients to a Single Internet Connection 836Connecting Several Servers to a Single Internet Connection 838
Chapter Summary 839Exercises 839Advanced Exercises 839
Chapter 26: Apache (httpd): Setting Up a Web Server 841
Introduction 842About Apache 842
Prerequisites 843More Information 843Notes 844
JumpStart I: Getting Apache Up and Running 844Modifying the httpd.conf Configuration File 845Testing Apache 845Putting Your Content in Place 846
JumpStart II: Setting Up Apache Using system-config-httpd 846
000.book Page xxxi Thursday, January 21, 2010 2:29 PM
xxxii Contents
Filesystem Layout 848Configuration Directives 850
Directives I: Directives You May Want to Modify as You Get Started 850Contexts and Containers 854Directives II: Advanced Directives 858
The Fedora/RHEL httpd.conf File 870Section 1: Global Environment 871Section 2: Main Server Configuration 872Section 3: Virtual Hosts 873
Redirects 873Multiviews 874Server-Generated Directory Listings (Indexing) 874Virtual Hosts 874Troubleshooting 875Modules 876
Module List 876mod_cgi and CGI Scripts 877mod_ssl 877Authentication Modules and .htaccess 880Scripting Modules 881
webalizer: Analyzes Web Traffic 881MRTG: Monitors Traffic Loads 882Error Codes 882Chapter Summary 883Exercises 884Advanced Exercises 884
PART VI Programming Tools 885
Chapter 27: Programming the Bourne Again Shell 887
Control Structures 888if...then 888if...then...else 892if...then...elif 895for...in 901for 902while 904until 908break and continue 910case 911select 917Here Document 919
000.book Page xxxii Thursday, January 21, 2010 2:29 PM
Contents xxxiii
File Descriptors 921Parameters and Variables 924
Array Variables 924Locality of Variables 926Special Parameters 928Positional Parameters 930Expanding Null and Unset Variables 935
Builtin Commands 936type: Displays Information About a Command 937read: Accepts User Input 937exec: Executes a Command 940trap: Catches a Signal 943kill: Aborts a Process 946getopts: Parses Options 946A Partial List of Builtins 949
Expressions 950Arithmetic Evaluation 950Logical Evaluation (Conditional Expressions) 951String Pattern Matching 952Operators 953
Shell Programs 958A Recursive Shell Script 959The quiz Shell Script 962
Chapter Summary 968Exercises 970Advanced Exercises 972
Chapter 28: The Perl Scripting Language 975
Introduction to Perl 976More Information 976Help 977perldoc 977Terminology 979Running a Perl Program 980Syntax 981
Variables 983Scalar Variables 985Array Variables 987Hash Variables 990
Control Structures 991if/unless 991if...else 993if...elsif...else 994foreach/for 995last and next 996while/until 998
000.book Page xxxiii Thursday, January 21, 2010 2:29 PM
xxxiv Contents
Working with Files 1000Sort 1003Subroutines 1005Regular Expressions 1007
Syntax and the =~ Operator 1008CPAN Modules 1013Examples 1015Chapter Summary 1019Exercises 1019Advanced Exercises 1020
PART VII Appendixes 1021
Appendix A: Regular Expressions 1023
Characters 1024Delimiters 1024Simple Strings 1024Special Characters 1024
Periods 1025Brackets 1025Asterisks 1026Carets and Dollar Signs 1026Quoting Special Characters 1027
Rules 1027Longest Match Possible 1027Empty Regular Expressions 1028
Bracketing Expressions 1028The Replacement String 1028
Ampersand 1029Quoted Digit 1029
Extended Regular Expressions 1029Appendix Summary 1031
Appendix B: Help 1033
Solving a Problem 1034Finding Linux-Related Information 1035
Documentation 1035Useful Linux Sites 1036Linux Newsgroups 1037Mailing Lists 1037Words 1038Software 1038Office Suites and Word Processors 1040
Specifying a Terminal 1040
000.book Page xxxiv Thursday, January 21, 2010 2:29 PM
Contents xxxv
Appendix C: Security 1043
Encryption 1044Public Key Encryption 1045Symmetric Key Encryption 1046Encryption Implementation 1047GnuPG/PGP 1048
File Security 1049Email Security 1049
MTAs (Mail Transfer Agents) 1049MUAs (Mail User Agents) 1050
Network Security 1050Network Security Solutions 1051Network Security Guidelines 1051
Host Security 1053Login Security 1054Remote Access Security 1055Viruses and Worms 1056Physical Security 1056
Security Resources 1058Appendix Summary 1061
Appendix D: The Free Software Definition 1063
Glossary 1067
Index 1117
000.book Page xxxv Thursday, January 21, 2010 2:29 PM
000.book Page xxxvi Thursday, January 21, 2010 2:29 PM
top related