A practical guide to Linux commands, editors, and shell programming Description based on print version record
β Scribed by Sobell, Mark G
- Publisher
- Prentice Hall PTR
- Year
- 2009;2010
- Tongue
- English
- Leaves
- 1083
- Edition
- 2nd ed
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
For use with all versions of Linux, including Ubuntu, (TM) Fedora, (TM) openSUSE, (TM) Red Hat, (R) Debian, Mandriva, Mint, and now OS X, too!
Get more done faster, and become a true Linux guru by mastering the command line!
Learn from hundreds of realistic, high-quality examples
NEW! Coverage of the Mac OS X command line and its unique tools
NEW! Expert primer on automating tasks with Perl
The Most Useful Linux Tutorial and Reference, with Hundreds of High-Quality Examples for Every Distribution-Now Covers OS X and Perl, Too! To be truly productive with Linux, you need to thoroughly master shells and the command line. Until now, you had to buy two books to gain that mastery: a tutorial on fundamental Linux concepts and techniques, plus a separate reference. Now, there's a far better solution. Renowned Linux expert Mark Sobell has brought together comprehensive, insightful guidance on the tools system administrators, developers, and power users need most, and an outstanding day-to-day reference, both in the same book. This book is 100 percent distribution and release agnostic: You can use it with any Linux system, now and for years to come. Use Macs, too? This new edition adds comprehensive coverage of the Mac OS X command line, including essential OS X-only tools and utilities other Linux/UNIX books ignore. Packed with hundreds of high-quality, realistic examples, this book gives you Linux from the ground up: the clearest explanations and most useful knowledge about everything from filesystems to shells, editors to utilities, and programming tools to regular expressions. Sobell has also added an outstanding new primer on Perl, the most important programming tool for Linux admins seeking to automate complex, time-consuming tasks. "A Practical Guide to Linux(R) Commands, Editors, and Shell Programming, Second Edition, " is the only book to deliver
Better, more realistic examples covering tasks you'll actually need to perform
Deeper insight, based on Sobell's immense knowledge of every Linux and OS X nook and cranny
A start-to-finish primer on Perl for every system administrator
In-depth coverage of basic and advanced Linux shell programming with bash and tcsh
Practical explanations of 100 core utilities, from aspell to xargs-including Mac OS X specific utilities from ditto to SetFile
All-new coverage of automating remote backups with 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 and using it interactively from the command line
Complete guides to high-productivity editing with both vim and emacs
A comprehensive, 286-page command reference section-now with revised and expanded indexes for faster access to the information you need
Instructions for updating systems automatically with apt-get and yum
Dozens of exercises to help you practice and gain confidence
And much more, including coverage of BitTorrent, gawk, sed, find, sort, bzip2, and regular expressions
β¦ Table of Contents
Cover......Page 1
CONTENTS......Page 14
PREFACE......Page 32
CHAPTER 1: WELCOME TO LINUX AND MAC OS X......Page 46
The Heritage of Linux: UNIX......Page 47
Fade to 1983......Page 48
Next Scene, 1991......Page 49
Have Fun!......Page 50
What Is So Good About Linux?......Page 51
Linux Is Portable......Page 54
The C Programming Language......Page 55
Linux Has a Kernel Programming Interface......Page 56
Linux Provides a Secure Hierarchical Filesystem......Page 57
The Shell: Command Interpreter and Programming Language......Page 58
Interprocess Communication......Page 60
GUIs: Graphical User Interfaces......Page 61
Software Development......Page 62
Exercises......Page 63
PART I: THE LINUX AND MAC OS X OPERATING SYSTEMS......Page 66
CHAPTER 2: GETTING STARTED......Page 68
Conventions Used in This Book......Page 69
Logging In from a Terminal or Terminal Emulator......Page 71
Working with the Shell......Page 73
su/sudo: Curbing Your Power (root Privileges)......Page 76
Where to Find Documentation......Page 78
More About Logging In......Page 85
Chapter Summary......Page 88
Advanced Exercises......Page 89
CHAPTER 3: THE UTILITIES......Page 90
Special Characters......Page 91
Basic Utilities......Page 92
Working with Files......Page 94
I (Pipe): Communicates Between Processes......Page 101
Four More Utilities......Page 102
Compressing and Archiving Files......Page 105
Locating Commands......Page 110
Obtaining User and System Information......Page 112
Communicating with Other Users......Page 115
Chapter Summary......Page 117
Advanced Exercises......Page 120
CHAPTER 4: THE FILESYSTEM......Page 122
Directory Files and Ordinary Files......Page 123
Pathnames......Page 128
Working with Directories......Page 130
Access Permissions......Page 138
ACLs: Access Control Lists......Page 144
Links......Page 149
Chapter Summary......Page 156
Exercises......Page 157
Advanced Exercises......Page 159
CHAPTER 5: THE SHELL......Page 162
The Command Line......Page 163
Standard Input and Standard Output......Page 168
Running a Command in the Background......Page 179
Filename Generation/Pathname Expansion......Page 181
Builtins......Page 186
Chapter Summary......Page 187
Exercises......Page 188
Advanced Exercises......Page 189
PART II: THE EDITORS......Page 192
CHAPTER 6: THE vim EDITOR......Page 194
History......Page 195
Tutorial: Using vim to Create and Edit a File......Page 196
Introduction to vim Features......Page 203
Command Mode: Moving the Cursor......Page 209
Input Mode......Page 213
Command Mode: Deleting and Changing Text......Page 214
Searching and Substituting......Page 218
Copying, Moving, and Deleting Text......Page 225
Reading and Writing Files......Page 228
Setting Parameters......Page 229
Advanced Editing Techniques......Page 234
Units of Measure......Page 238
Chapter Summary......Page 241
Exercises......Page 246
Advanced Exercises......Page 247
CHAPTER 7: THE emacs EDITOR......Page 250
History......Page 251
Tutorial: Getting Started with emacs......Page 253
The emacs GUI......Page 260
Basic Editing Commands......Page 261
Online Help......Page 268
Advanced Editing......Page 270
Major Modes: Language-Sensitive Editing......Page 284
Customizing emacs......Page 294
Chapter Summary......Page 299
Exercises......Page 307
Advanced Exercises......Page 309
PART III: THE SHELLS......Page 312
CHAPTER 8: THE BOURNE AGAIN SHELL......Page 314
Background......Page 315
Shell Basics......Page 316
Parameters and Variables......Page 335
Special Characters......Page 349
Processes......Page 351
History......Page 353
Aliases......Page 369
Functions......Page 372
Controlling bash: Features and Options......Page 375
Processing the Command Line......Page 379
Chapter Summary......Page 388
Exercises......Page 390
Advanced Exercises......Page 392
CHAPTER 9: THE TC SHELL......Page 394
Shell Scripts......Page 395
Entering and Leaving the TC Shell......Page 396
Features Common to the Bourne Again and TC Shells......Page 398
Redirecting Standard Error......Page 404
Working with the Command Line......Page 405
Variables......Page 410
Control Structures......Page 423
Builtins......Page 432
Chapter Summary......Page 436
Exercises......Page 437
Advanced Exercises......Page 439
PART IV: PROGRAMMING TOOLS......Page 440
CHAPTER 10: PROGRAMMING THE BOURNE AGAIN SHELL......Page 442
Control Structures......Page 443
File Descriptors......Page 476
Parameters and Variables......Page 479
Builtin Commands......Page 491
Expressions......Page 505
Shell Programs......Page 513
Chapter Summary......Page 523
Exercises......Page 525
Advanced Exercises......Page 527
CHAPTER 11: THE PERL SCRIPTING LANGUAGE......Page 530
Introduction to Perl......Page 531
Variables......Page 538
Control Structures......Page 546
Working with Files......Page 555
Sort......Page 558
Subroutines......Page 560
Regular Expressions......Page 562
CPAN Modules......Page 568
Examples......Page 570
Exercises......Page 574
Advanced Exercises......Page 575
CHAPTER 12: THE AWK PATTERN PROCESSING LANGUAGE......Page 576
Arguments......Page 577
Options......Page 578
Language Basics......Page 579
Examples......Page 586
Advanced gawk Programming......Page 603
Exercises......Page 608
Advanced Exercises......Page 609
CHAPTER 13: THE SED EDITOR......Page 610
Options......Page 611
Editor Basics......Page 612
Examples......Page 615
Exercises......Page 626
CHAPTER 14: THE rsync SECURE COPY UTILITY......Page 628
Options......Page 629
Examples......Page 632
Exercises......Page 639
PART V: COMMAND REFERENCE......Page 642
Standard Multiplicative Suffixes......Page 647
Common Options......Page 648
The sample Utility......Page 649
sample: Brief description of what the utility does......Page 650
aspell: Checks a file for spelling errors......Page 652
at: Executes commands at a specified time......Page 656
bzip2: Compresses or decompresses files......Page 660
cal: Displays a calendar......Page 662
cat: Joins and displays files......Page 663
cd: Changes to another working directory......Page 665
chgrp: Changes the group associated with a file......Page 667
chmod: Changes the access mode (permissions) of a file......Page 671
chown: Changes the owner of a file and/or the group the file is associated with......Page 676
cmp: Compares two files......Page 679
comm: Compares sorted files......Page 681
configure: Configures source code automatically......Page 683
cp: Copies files......Page 685
cpio: Creates an archive, restores files from an archive, or copies a directory hierarchy......Page 689
crontab: Maintains crontab files......Page 694
cut: Selects characters or fields from input lines......Page 697
date: Displays or sets the system time and date......Page 700
dd: Converts and copies a file......Page 703
df: Displays disk space usage......Page 706
diff: Displays the differences between two text files......Page 708
diskutil: Checks, modifies, and repairs local volumes: OS X......Page 713
ditto: Copies files and creates and unpacks archives: OS X......Page 716
dmesg: Displays kernel messages......Page 718
dscl: Displays and manages Directory Service information......Page 719
du: Displays information on disk usage by directory hierarchy and/or file......Page 722
echo: Displays a message......Page 725
expr: Evaluates an expression......Page 727
file: Displays the classification of a file......Page 731
find: Finds files based on criteria......Page 733
finger: Displays information about users......Page 740
fmt: Formats text very simply......Page 742
fsck: Checks and repairs a filesystem......Page 744
ftp: Transfers files over a network......Page 749
gawk: Searches for and processes patterns in a file......Page 756
gcc: Compiles C and C++ programs......Page 757
GetFileInfo: Displays file attributes: OS X......Page 762
grep: Searches for a pattern in files......Page 764
gzip: Compresses or decompresses files......Page 769
head: Displays the beginning of a file......Page 772
kill: Terminates a process by PID......Page 774
killall: Terminates a process by name......Page 776
launchctl: Controls the launchd daemon: OS X......Page 778
less: Displays text files, one screen at a time......Page 780
ln: Makes a link to a file......Page 785
lpr: Sends files to printers......Page 787
ls: Displays information about one or more files......Page 790
make: Keeps a set of programs current......Page 798
man: Displays documentation for commands......Page 804
mkdir: Creates a directory......Page 808
mkfs: Creates a filesystem on a device......Page 809
Mtools: Uses DOS-style commands on files and directories......Page 812
mv: Renames or moves a file......Page 816
nice: Changes the priority of a command......Page 818
nohup: Runs a command that keeps running after you log out......Page 820
od: Dumps the contents of a file......Page 821
open: Opens files, directories, and URLs: OS X......Page 825
otool: Displays object, library, and executable files: OS X......Page 827
paste: Joins corresponding lines from files......Page 829
pax: Creates an archive, restores files from an archive, or copies a directory hierarchy......Page 831
plutil: Manipulates property list files: OS X......Page 837
pr: Paginates files for printing......Page 839
ps: Displays process status......Page 841
rcp: Copies one or more files to or from a remote system......Page 845
renice: Changes the priority of a process......Page 847
rlogin: Logs in on a remote system......Page 848
rm: Removes a file (deletes a link)......Page 849
rmdir: Removes directories......Page 851
rsh: Executes commands on a remote system......Page 852
rsync: Copies files and directory hierarchies securely over a network......Page 854
scp: Securely copies one or more files to or from a remote system......Page 855
sed: Edits a file noninteractively......Page 857
SetFile: Sets file attributes: OS X......Page 858
sleep: Creates a process that sleeps for a specified interval......Page 860
sort: Sorts and/or merges files......Page 862
split: Divides a file into sections......Page 871
ssh: Securely executes commands on a remote system......Page 873
stat: Displays information about files......Page 880
strings: Displays strings of printable characters......Page 882
stty: Displays or sets terminal parameters......Page 883
sysctl: Displays and alters kernel variables: OS X......Page 887
tail: Displays the last part (tail) of a file......Page 888
tar: Stores or retrieves files to/from an archive file......Page 891
tee: Copies standard input to standard output and one or more files......Page 896
telnet: Connects to a remote system over a network......Page 897
test: Evaluates an expression......Page 899
top: Dynamically displays process status......Page 903
touch: Creates a file or changes a fileβs access and/or modification time......Page 907
tr: Replaces specified characters......Page 909
tty: Displays the terminal pathname......Page 912
tune2fs: Changes parameters on an ext2, ext3, or ext4 filesystem......Page 913
umask: Establishes the file-creation permissions mask......Page 915
uniq: Displays unique lines......Page 917
w: Displays information about system users......Page 919
wc: Displays the number of lines, words, and bytes......Page 921
which: Shows where in PATH a command is located......Page 922
who: Displays information about logged-in users......Page 924
xargs: Converts standard input to command lines......Page 926
PART VI: APPENDIXES......Page 930
APPENDIX A: REGULAR EXPRESSIONS......Page 932
Special Characters......Page 933
Rules......Page 936
The Replacement String......Page 937
Extended Regular Expressions......Page 938
Appendix Summary......Page 940
APPENDIX B: HELP......Page 942
Solving a Problem......Page 943
Finding Linux and OS XβRelated Information......Page 944
Specifying a Terminal......Page 951
APPENDIX C: KEEPING THE SYSTEM UP-TO-DATE......Page 954
Using yum......Page 955
Using apt-get......Page 961
BitTorrent......Page 966
APPENDIX D: MAC OS X NOTES......Page 970
Open Directory......Page 971
Filesystems......Page 972
Extended Attributes......Page 973
Activating the META Key......Page 980
Mac OS X Implementation of Linux Features......Page 981
GLOSSARY......Page 984
A......Page 985
B......Page 987
C......Page 990
D......Page 995
E......Page 998
F......Page 999
G......Page 1000
H......Page 1001
I......Page 1004
J......Page 1006
L......Page 1007
M......Page 1009
N......Page 1012
O......Page 1014
P......Page 1015
Q......Page 1018
R......Page 1019
S......Page 1022
T......Page 1027
U......Page 1029
W......Page 1031
Z......Page 1033
FILE TREE INDEX......Page 1034
C......Page 1036
J......Page 1037
S......Page 1038
Z......Page 1039
MAIN INDEX......Page 1040
A......Page 1041
B......Page 1042
C......Page 1046
D......Page 1048
E......Page 1050
F......Page 1054
G......Page 1056
H......Page 1057
I......Page 1058
L......Page 1059
M......Page 1061
N......Page 1062
O......Page 1063
P......Page 1064
Q......Page 1066
R......Page 1067
S......Page 1068
T......Page 1072
U......Page 1074
V......Page 1075
W......Page 1078
Z......Page 1079
β¦ Subjects
Computer Science;Programming;Computers;Science;Technology;Reference;Nonfiction;Textbooks;Academic;School
π SIMILAR VOLUMES
<BLOCKQUOTE> <P style="MARGIN: 0px">β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.β </P> <P style="MARGIN: 0px">β<I>Jon βmaddogβ Hall, Executive Director, Linux International</I>Β </P>
The Most Useful Tutorial and Reference, with Hundreds of High-Quality Examples for Every Popular Linux Distribution β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,
A Practical Guide to Linux Commands, Editors, and Shell Programming by Mark G. Sobell, Matthew Helmke The Most Useful Tutorial and Reference, with Hundreds of High-Quality Examples for Every Popular Linux Distribution βFirst Sobell taught people how to use Linux . . . now he teaches you the powe
Part I. The Linux and MacOS operating systems. Getting started ; The utilities ; The filesystem ; The shell -- Part II. The editors. The vim editor ; The emacs editor -- Part III. The shells. The Bourne again shell (bash) ; The TC shell (tcsh) -- Part IV. Programming tools. Programming the Bourne ag