p. 2
linux command line and shell scripting bible ® richard blum wiley publishing inc.
[close]
p. 4
linux® command line and shell scripting bible
[close]
p. 6
linux command line and shell scripting bible ® richard blum wiley publishing inc.
[close]
p. 7
linux®command line and shell scripting bible published by wiley publishing inc 10475 crosspoint boulevard indianapolis in 46256 www.wiley.com copyright © 2008 by wiley publishing inc indianapolis indiana published simultaneously in canada isbn 978-0-470-25128-7 manufactured in the united states of america 10 9 8 7 6 5 4 3 2 1 no part of this publication may be reproduced stored in a retrieval system or transmitted in any form or by any means electronic mechanical photocopying recording scanning or otherwise except as permitted under sections 107 or 108 of the 1976 united states copyright act without either the prior written permission of the publisher or authorization through payment of the appropriate per-copy fee to the copyright clearance center 222 rosewood drive danvers ma 01923 978 750-8400 fax 978 646-8600 requests to the publisher for permission should be addressed to the legal department wiley publishing inc 10475 crosspoint blvd indianapolis in 46256 317 572-3447 fax 317 572-4355 or online at http www.wiley.com/go/permissions limit of liability/disclaimer of warranty the publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties including without limitation warranties of fitness for a particular purpose no warranty may be created or extended by sales or promotional materials the advice and strategies contained herein may not be suitable for every situation this work is sold with the understanding that the publisher is not engaged in rendering legal accounting or other professional services if professional assistance is required the services of a competent professional person should be sought neither the publisher nor the author shall be liable for damages arising herefrom the fact that an organization or website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or website may provide or recommendations it may make further readers should be aware that internet websites listed in this work may have changed or disappeared between when this work was written and when it is read for general information on our other products and services or to obtain technical support please contact our customer care department within the u.s at 800 762-2974 outside the u.s at 317 572-3993 or fax 317 572-4002 library of congress cataloging-in-publication data is available from the publisher trademarks wiley the wiley logo and related trade dress are trademarks or registered trademarks of john wiley sons inc and/or its affiliates in the united states and other countries and may not be used without written permission linux is a registered trademark of linus torvald all other trademarks are the property of their respective owners wiley publishing inc is not associated with any product or vendor mentioned in this book wiley also publishes its books in a variety of electronic formats some content that appears in print may not be available in electronic books.
[close]
p. 8
to all the people who ve helped form my education parents relatives teachers coworkers and even anonymous posters on the internet always be prepared to accept education from wherever you find it always continue to learn new things for the lord gives wisdom and from his mouth come knowledge and understanding proverbs 2:6 niv
[close]
p. 9
about the author richard blum has worked in the it industry for over 19 years as both a systems and network administrator during this time he has administered unix linux novell and microsoft servers as well as helped design and maintain a 3500-user network utilizing cisco switches and routers he has used linux servers and shell scripts to perform automated network monitoring and has written shell scripts in just about every unix shell environment rich has a bachelor of science degree in electrical engineering and a master of science degree in management specializing in management information systems from purdue university he is the author of several linux books including sendmail for linux running qmail postfix open source e-mail security network performance open source toolkit and professional assembly language programming he s also a coauthor of professional linux programming and linux for dummies 8th edition when he s not being a computer nerd rich plays bass guitar for his church worship band and enjoys spending time with his wife barbara and their two daughters katie jane and jessica.
[close]
p. 10
credits acquisitions editor jenny watson senior development editor tom dinse technical editor john kennedy production editor angela smith copy editor foxxe editorial services editorial manager mary beth wakefield production manager tim tate vice president and executive group publisher richard swadley vice president and executive publisher joseph b wikert project coordinator cover lynsey stanford proofreader word one new york indexer melanie belkin
[close]
p. 12
acknowledgments xxv introduction xxvii part i the linux command line chapter chapter chapter chapter chapter chapter chapter 1 2 3 4 5 6 7 starting with linux shells 3 getting to the shell 25 basic bash shell commands 59 more bash shell commands 91 using linux environment variables 123 understanding linux file permissions 147 working with editors 171 part ii shell scripting basics chapter chapter chapter chapter chapter chapter 8 basic script building 201 9 using structured commands 229 10 more structured commands 255 11 handling user input 285 12 presenting data 313 13 script control 335 part iii advanced shell scripting chapter chapter chapter chapter chapter chapter 14 15 16 17 18 19 creating functions 363 adding color to scripts 385 introducing sed and gawk 419 regular expressions 447 advanced sed 473 advanced gawk 501 part iv alternative linux shells chapter chapter chapter chapter 20 21 22 23 the the the the ash shell 533 tcsh shell 557 korn shell 587 zsh shell 611 ix
[close]
p. 13
contents at a glance part v advanced topics chapter chapter chapter chapter 24 25 26 27 using a database 639 using the web 673 using e-mail 701 shell scripts for administrators 725 appendix a quick guide to bash commands 749 appendix b quick guide to sed and gawk 759 appendix c comparing shells 771 index 777 x
[close]
p. 14
acknowledgments xxv introduction xxvii part i the linux command line chapter 1 starting with linux shells 3 what is linux 3 looking into the linux kernel 4 the gnu utilities 12 the linux desktop environment 14 linux distributions 20 core linux distributions 21 specialized linux distributions 22 the linux livecd 23 summary 24 chapter 2 getting to the shell 25 terminal emulation 25 graphics capabilities 27 the keyboard 30 the terminfo database 31 the linux console 35 the xterm terminal 36 command line parameters 37 the xterm main menu 38 the vt options menu 41 the vt fonts menu 43 the konsole terminal 45 command line parameters 45 sessions 45 the menu bar 48 the gnome terminal 52 the command line parameters 52 tabs 53 the menu bar 54 summary 58 xi
[close]
p. 15
contents chapter 3 basic bash shell commands 59 starting the shell 59 the shell prompt 60 the bash manual 63 filesystem navigation 64 the linux filesystem 64 traversing directories 66 file and directory listing 69 basic listing 69 modifying the information presented 71 the complete parameter list 72 filtering listing output 74 file handling 75 creating files 75 copying files 76 linking files 79 renaming files 80 deleting files 81 directory handling 82 creating directories 82 deleting directories 82 viewing file contents 83 viewing file statistics 84 viewing the file type 84 viewing the whole file 85 viewing parts of a file 89 summary 90 chapter 4 more bash shell commands 91 monitoring programs 91 peeking at the processes 91 real-time process monitoring 98 stopping processes 101 monitoring disk space 104 mounting media 104 using the df command 108 using the du command 109 working with data files 110 sorting data 110 searching for data 114 compressing data 116 archiving data 120 summary 121 xii
[close]