- ホーム
- > 洋書
- > 英文書
- > Computer / Operating Systems
Full Description
"First Sobell taught people how to use Linux . . . now he teaches you the power of Linux. A must-have book for anyone who wants to take Linux to the next level." -Jon "maddog" Hall, Executive Director, Linux International New Chapters on Python and MySQL-Covers Perl, too!Learn from hundreds of realistic, high-quality examples, and become a true Linux command-line guru! NEW! Covers busybox, Midnight Commander, screen, and sshfs/curlftpf Covers the Mac OS X command line and its unique tools 295-page reference covers 98 utilities, including Mac OS X commands! For use with all popular versions of Linux, including Ubuntu (TM), Fedora (TM), openSUSE (TM), Red Hat (R), Debian, Mageia, Mint, Arch, CentOS, and Mac OS X, too!The Most Useful Tutorial and Reference, with Hundreds of High-Quality Examples for Every Popular Linux Distribution Linux is today's dominant Internet server platform. System administrators and Web developers need deep Linux fluency, including expert knowledge of shells and the command line. This is the only guide with everything you need to achieve that level of Linux mastery. Renowned Linux expert Mark Sobell has brought together comprehensive, insightful guidance on the tools sysadmins, developers, and power users need most, and has created an outstanding day-to-day reference. This title is 100 percent distribution and release agnostic. Packed with hundreds of high-quality, realistic examples, it presents Linux from the ground up: the clearest explanations and most useful information about everything from filesystems to shells, editors to utilities, and programming tools to regular expressions. Use a Mac? You'll find coverage of the Mac OS X command line, including OS X-only tools and utilities other Linux/UNIX titles ignore. Sobell presents a new MySQL chapter. There's even an expert introduction to Python-today's most valuable tool for automating complex, time-consuming administration tasks. A Practical Guide to Linux (R) Commands, Editors, and Shell Programming, Third Edition, is the only guide to deliver A MySQL chapter to get you started with this ubiquitous relational database management system (RDBMS) A masterful introduction to Python for system administrators and power users New coverage of the busybox single binary collection of utilities, the screen terminal session manager/multiplexer, and the mc (Midnight Commander) textual file manager, plus a new chapter on using ssh for secure communication In-depth coverage of the bash and tcsh shells, including a complete discussion of environment, inheritance, and process locality, plus coverage of basic and advanced shell programming Practical explanations of 98 core utilities, from aspell to xargs, including printf and sshfs/curlftpfs, PLUS Mac OS X-specific utilities from ditto to SetFile Expert guidance on automating remote backups using rsync Dozens of system security tips, including step-by-step walkthroughs of implementing secure communications using ssh and scp Tips and tricks for customizing the shell, including step values, sequence expressions, the eval builtin, and implicit command-line continuation High-productivity editing techniques using vim and emacs A comprehensive, 295-page command reference section covering 98 utilities, including find, grep, sort, and tar Instructions for updating systems using apt-get and yum And much more, including coverage of BitTorrent, gawk, sed, find, sort, bzip2, and regular expressions
Contents
Preface xxxviiChapter 1: Welcome to Linux and Mac OS X 1The History of UNIX and GNU-Linux 3What Is So Good About Linux? 6Overview of Linux 11Additional Features of Linux 16Chapter Summary 18Exercises 18Part I: The Linux and Mac OS X Operating Systems 21Chapter 2: Getting Started 23Conventions Used in This Book 24Logging In from a Terminal (Emulator) 26Working from the Command Line 28su/sudo: Curbing Your Power (root Privileges) 32Where to Find Documentation 33More About Logging In and Passwords 42Chapter Summary 46Exercises 46Advanced Exercises 47Chapter 3: The Utilities 49Special Characters 50Basic Utilities 51Working with Files 53| (Pipeline): Communicates Between Processes 60Four More Utilities 61Compressing and Archiving Files 63Locating Utilities 68Displaying User and System Information 70Communicating with Other Users 74Email 76Chapter Summary 76Exercises 79Advanced Exercises 80Chapter 4: The Filesystem 81The Hierarchical Filesystem 82Directory Files and Ordinary Files 83Pathnames 87Working with Directories 90Access Permissions 98ACLs: Access Control Lists 104Links 109Chapter Summary 119Exercises 120Advanced Exercises 122Chapter 5: The Shell 125The Command Line 126Standard Input and Standard Output 133Running a Command in the Background 146Filename Generation/Pathname Expansion 148Builtins 153Chapter Summary 153Exercises 155Advanced Exercises 156Part II: The Editors 157Chapter 6: The vim Editor 159History 160Tutorial: Using vim to Create and Edit a File 161Introduction to vim Features 168Command Mode: Moving the Cursor 174Input Mode 178Command Mode: Deleting and Changing Text 179Searching and Substituting 183Miscellaneous Commands 190Copying, Moving, and Deleting Text 190Reading and Writing Files 193Setting Parameters 194Advanced Editing Techniques 199Units of Measure 203Chapter Summary 206Exercises 211Advanced Exercises 212Chapter 7: The emacs Editor 213History 214Tutorial: Getting Started with emacs 216Basic Editing Commands 223Online Help 229Advanced Editing 232Major Modes: Language-Sensitive Editing 246Customizing emacs 256More Information 260Chapter Summary 261Exercises 269Advanced Exercises 270Part III: The Shells 273Chapter 8: The Bourne Again Shell (bash) 275Background 276Startup Files 278Commands That Are Symbols 281Redirecting Standard Error 282Writing and Executing a Simple Shell Script 284Control Operators: Separate and Group Commands 289Job Control 294Manipulating the Directory Stack 297Parameters and Variables 300Special Characters 315Locale 316Time 320Processes 323History 326Aliases 342Functions 346Controlling bash: Features and Options 349Processing the Command Line 354Chapter Summary 364Exercises 366Advanced Exercises 368Chapter 9: The TC Shell (tcsh) 369Shell Scripts 370Entering and Leaving the TC Shell 371Features Common to the Bourne Again and TC Shells 373Redirecting Standard Error 379Working with the Command Line 380Variables 385Control Structures 398Builtins 407Chapter Summary 411Exercises 412Advanced Exercises 414Part IV: Programming Tools 415Chapter 10: Programming the Bourne Again Shell (bash) 417Control Structures 418 File Descriptors 452Parameters 458Variables 467Builtin Commands 476Expressions 492Implicit Command-Line Continuation 499Shell Programs 500Chapter Summary 510Exercises 512Advanced Exercises 514Chapter 11: The Perl Scripting Language 517Introduction to Perl 518 Variables 526Control Structures 533Working with Files 542Sort 546Subroutines 547Regular Expressions 550CPAN Modules 555Examples 558Chapter Summary 561Exercises 562Advanced Exercises 562Chapter 12: The Python Programming Language 563Introduction 564 Scalar Variables, Lists, and Dictionaries 568Control Structures 574Reading from and Writing to Files 579Regular Expressions 583Defining a Function 584Using Libraries 585Lambda Functions 589List Comprehensions 590Chapter Summary 591Exercises 592Advanced Exercises 592Chapter 13: The MySQL Database Management System 595Notes 596 Installing a MySQL Server and Client 599Client Options 600Setting Up MySQL 601Creating a Database 603Adding a User 604Examples 605Chapter Summary 617Exercises 617Chapter 14: The AWK Pattern Processing Language 619Syntax 620 Arguments 620Options 621Notes 622Language Basics 622Examples 629Advanced gawk Programming 646Chapter Summary 651Exercises 651Advanced Exercises 652Chapter 15: The sed Editor 653Syntax 654 Arguments 654Options 654Editor Basics 655Examples 658Chapter Summary 669Exercises 669Part V: Secure Network Utilities 671Chapter 16: The rsync Secure Copy Utility 673Syntax 674 Arguments 674Options 675Examples 677Chapter Summary 684Exercises 685Chapter 17: The OpenSSH Secure Communication Utilities 687Introduction to OpenSSH 688 Running the ssh, scp, and sftp OpenSSH Clients 691Tunneling/Port Forwarding 706Chapter Summary 708Exercises 709Advanced Exercises 709Part VI: Command Reference 711Utilities That Display and Manipulate Files 713 Network Utilities 714Utilities That Display and Alter Status 715Utilities That Are Programming Tools 716Miscellaneous Utilities 716Standard Multiplicative Suffixes 717Common Options 718The sample Utility 718sample: Brief description of what the utility does 719aspell: Checks a file for spelling errors 721at: Executes commands at a specified time 725busybox: Implements many standard utilities 729bzip2: Compresses or decompresses files 732cal: Displays a calendar 734cat: Joins and displays files 735cd: Changes to another working directory 737chgrp: Changes the group associated with a file 739chmod: Changes the access mode (permissions) of a file 741chown: Changes the owner of a file and/or the group the file is associated with 746cmp: Compares two files 748comm: Compares sorted files 750configure: Configures source code automatically 752cp: Copies files 754cpio: Creates an archive, restores files from an archive, or copies a directory hierarchy 758crontab: Maintains crontab files 763cut: Selects characters or fields from input lines 766date: Displays or sets the system time and date 769dd: Converts and copies a file 772df: Displays disk space usage 775diff: Displays the differences between two text files 777diskutil: Checks, modifies, and repairs local volumes (OS X) 782ditto: Copies files and creates and unpacks archives (OS X) 785dmesg: Displays kernel messages 787dscl: Displays and manages Directory Service information (OS X) 788du: Displays information on disk usage by directory hierarchy and/or file 791echo: Displays a message 794expand/unexpand: Converts TABs to SPACEs and SPACEs to TABs 796expr: Evaluates an expression 798file: Displays the classification of a file 802find: Finds files based on criteria 804finger: Displays information about users 810fmt: Formats text very simply 812fsck: Checks and repairs a filesystem 814ftp: Transfers files over a network 819gawk: Searches for and processes patterns in a file 825gcc: Compiles C and C++ programs 826GetFileInfo: Displays file attributes (OS X) 831grep: Searches for a pattern in files 833gzip: Compresses or decompresses files 838head: Displays the beginning of a file 841join: Joins lines from two files based on a common field 843kill: Terminates a process by PID 846killall: Terminates a process by name 848launchctl: Controls the launchd daemon (OS X) 850less: Displays text files, one screen at a time 852ln: Makes a link to a file 856lpr: Sends files to printers 858ls: Displays information about one or more files 861make: Keeps a set of programs current 869man: Displays documentation for utilities 875mc: Manages files in a textual environment (aka Midnight Commander) 879mkdir: Creates a directory 886mkfs: Creates a filesystem on a device 887mv: Renames or moves a file 890nice: Changes the priority of a command 892nl: Numbers lines from a file 894nohup: Runs a command that keeps running after you log out 896od: Dumps the content of a file 897open: Opens files, directories, and URLs (OS X) 901otool: Displays object, library, and executable files (OS X) 903paste: Joins corresponding lines from files 905pax: Creates an archive, restores files from an archive, or copies a directory hierarchy 907plutil: Manipulates property list files (OS X) 913pr: Paginates files for printing 915printf: Formats string and numeric data 917ps: Displays process status 921renice: Changes the priority of a process 925rm: Removes a file (deletes a link) 926rmdir: Removes directories 928rsync: Copies files and directory hierarchies securely over a network 929scp: Securely copies one or more files to or from a remote system 930screen: Manages several textual windows 931sed: Edits a file noninteractively 937SetFile: Sets file attributes (OS X) 938sleep: Creates a process that sleeps for a specified interval 940sort: Sorts and/or merges files 942split: Divides a file into sections 951ssh: Securely executes commands on a remote system 953sshfs/curlftpfs: Mounts a directory on an OpenSSH or FTP server as a local directory 954stat: Displays information about files 957strings: Displays strings of printable characters from files 959stty: Displays or sets terminal parameters 960sysctl: Displays and alters kernel variables at runtime 964tail: Displays the last part (tail) of a file 965tar: Stores or retrieves files to/from an archive file 968tee: Copies standard input to standard output and one or more files 973telnet: Connects to a remote computer over a network 974test: Evaluates an expression 978top: Dynamically displays process status 981touch: Creates a file or changes a file's access and/or modification time 985tr: Replaces specified characters 987tty: Displays the terminal pathname 990tune2fs: Changes parameters on an ext2, ext3, or ext4 filesystem 991umask: Specifies the file-creation permissions mask 994uniq: Displays unique lines from a file 996w: Displays information about local system users 998wc: Displays the number of lines, words, and bytes in one or more files 1000which: Shows where in PATH a utility is located 1001who: Displays information about logged-in users 1003xargs: Converts standard input to command lines 1005Part VII: Appendixes 1009Appendix A: Regular Expressions 1011Characters 1012 Delimiters 1012Simple Strings 1012Special Characters 1012Rules 1015Bracketing Expressions 1016The Replacement String 1016Extended Regular Expressions 1017Appendix Summary 1019Appendix B: Help 1021Solving a Problem 1022 Finding Linux and OS X Related Information 1023Specifying a Terminal 1024Appendix C: Keeping the System Up-to-Date 1027Using yum 1028 Using apt-get 1034BitTorrent 1038Appendix D: Mac OS X Notes 1041Open Directory 1042 Filesystems 1043Extended Attributes 1044Activating the Terminal META Key 1049Startup Files 1050Remote Logins 1050Many Utilities Do Not Respect Apple Human Interface Guidelines 1050Installing Xcode and MacPorts 1050Mac OS X Implementation of Linux Features 1051Glossary 1053File Tree Index 1105Utility Index 1107Main Index 1111