Michael Stutz9781886411487, 1886411484
The Linux Cookbook shows how to use Linux for everyday tasks such as: printing; converting and managing files; editing and formatting text; working with digital audio; creating and manipulating graphics; and connecting to the Internet. The quick-reference, cookbook-style format includes step-by-step Linux “recipes” covering many hundreds of day-to-day issues.
Table of contents :
Table of Contents……Page 2
The Linux Cookbook: Tips and Techniques for Everyday Use……Page 17
Preface……Page 19
1.0 Format of Recipes……Page 20
1.1 Assumptions, Scope, and Exclusions……Page 21
1.2 Typographical Conventions……Page 22
1.3 Versions, Latest Edition, and Errata……Page 23
1.4 Acknowledgments……Page 24
PART ONE: Working with Linux……Page 26
2.1.1 What’s Unix?……Page 27
2.1.2 What’s Free Software?……Page 28
2.1.3 What’s Open Source?……Page 29
2.1.5 What’s Debian?……Page 30
2.1.6 Unix and the Tools Philosophy……Page 31
2.2 What to Try First……Page 33
2.3 If You Need More Help……Page 34
3.1 Controlling Power to the System……Page 36
3.2 Accounts and Privileges……Page 37
3.2.1 Logging In to the System……Page 38
3.3 Console Basics……Page 40
3.3.1 Switching between Consoles……Page 41
3.3.3 Keys for Console Manipulation……Page 42
3.4 Running a Command……Page 43
3.5 Changing Your Password……Page 44
3.6.1 Listing Your Username……Page 45
3.6.3 Listing Who Is on and What They’re Doing……Page 46
3.6.4 Listing the Last Times a User Logged In……Page 47
3.7.1 Listing Your Current Processes……Page 48
3.7.3 Listing All Processes on the System……Page 49
3.8 Help Facilities……Page 50
3.8.1 Finding the Right Tool for the Job……Page 51
3.8.3 Listing the Usage of a Tool……Page 52
3.8.4 Reading a Page from the System Manual……Page 53
3.8.5 Using the GNU Info System……Page 54
3.8.6 Reading System Documentation and Help Files……Page 56
4.1 Keys for Command Line Editing……Page 58
4.1.1 Passing Special Characters to Commands……Page 60
4.1.2 Letting the Shell Complete What You Type……Page 61
4.1.3 Repeating the Last Command You Typed……Page 62
4.2 Redirecting Input and Output……Page 63
4.2.2 Redirecting Output to a File……Page 64
4.2.4 Redirecting Output to Another Command’s Input……Page 65
4.3.1 Suspending a Job……Page 66
4.3.2 Putting a Job in the Background……Page 67
4.3.4 Listing Your Jobs……Page 68
4.4 Command History……Page 69
4.4.1 Viewing Your Command History……Page 70
4.5 Recording a Shell Session……Page 71
4.6 Customizing Your Shell……Page 72
4.6.1 Changing the Shell Prompt……Page 73
4.6.2 Making a Command Alias……Page 74
4.6.4 Customizing Future Shells……Page 75
5.1 Running X……Page 78
5.1.2 Stopping X……Page 81
5.2 Running a Program in X……Page 82
5.2.1 Specifying Window Size and Location……Page 83
5.2.3 Specifying Window Font……Page 85
5.3 Manipulating X Client Windows……Page 86
5.3.3 Destroying a Window……Page 87
5.4 Moving around the Desktop……Page 88
5.5 Running a Shell in X……Page 89
5.6.1 Switching between Video Modes……Page 90
5.6.3 Changing the Root Window Parameters……Page 91
5.6.4 Choosing a Window Manager……Page 92
PART TWO: Files……Page 94
6. Files and Directories……Page 95
6.1 Naming Files and Directories……Page 99
6.1.2 Making a Directory……Page 100
6.2 Changing Directories……Page 101
6.2.3 Getting the Name of the Current Directory……Page 102
6.3 Listing Directories……Page 103
6.3.1 Listing File Attributes……Page 104
6.3.2 Listing Directories Recursively……Page 105
6.3.4 Listing Hidden Files……Page 106
6.3.6 Listing Directory Tree Graphs……Page 107
6.3.7 Additional Directory Listing Options……Page 108
6.4 Copying Files and Directories……Page 109
6.5 Moving Files and Directories……Page 110
6.5.1 Changing File Names to Lowercase……Page 111
6.5.2 Renaming Multiple Files with the Same Extension……Page 112
6.6 Removing Files and Directories……Page 113
6.6.1 Removing a File with a Strange Name……Page 114
6.7 Giving a File More than One Name……Page 115
6.8 Specifying File Names with Patterns……Page 116
6.9 Browsing Files……Page 118
7.1.1 Listing the Groups a User Belongs To……Page 119
7.1.2 Listing the Members of a Group……Page 120
7.2.2 Changing the Ownership of a File……Page 121
7.3 Controlling Access to Files……Page 122
7.3.1 Listing the Permissions of a File……Page 123
7.3.3 Write-Protecting a File……Page 124
7.3.5 Making a File Public……Page 125
7.3.6 Making a File Executable……Page 126
8.1 Finding All Files That Match a Pattern……Page 127
8.2.1 Finding Files in a Directory Tree by Name……Page 128
8.2.2 Finding Files in a Directory Tree by Size……Page 130
8.2.3 Finding Files in a Directory Tree by Modification Time……Page 131
8.2.4 Finding Files in a Directory Tree by Owner……Page 132
8.2.6 Finding Files by Multiple Criteria……Page 133
8.3.1 Finding the Largest Files in a Directory……Page 136
8.3.4 Finding the Largest Directories……Page 137
8.3.5 Finding the Number of Files in a Listing……Page 138
8.4 Finding Where a Command Is Located……Page 139
9.1 Determining File Type and Format……Page 140
9.2 Changing File Modification Time……Page 141
9.3 Splitting a File into Smaller Ones……Page 142
9.4.2 Finding the Differences between Files……Page 143
9.4.3 Patching a File with a Difference Report……Page 144
9.5.2 Decompressing a File……Page 145
9.6 File Archives……Page 146
9.6.2 Listing the Contents of an Archive……Page 147
9.6.3 Extracting Files from an Archive……Page 148
9.7.1 Checking In a File Revision……Page 149
9.7.2 Checking Out a File Revision……Page 151
9.7.3 Viewing a File’s Revision Log……Page 152
PART THREE: Text……Page 153
10.1 Perusing Text……Page 154
10.1.2 Perusing Multiple Text Files……Page 155
10.1.3 Commands Available While Perusing Text……Page 156
10.2.1 Showing Non-printing Characters……Page 157
10.2.2 Outputting a Beginning Part of a Text……Page 158
10.2.4 Outputting a Middle Part of a Text……Page 159
10.2.5 Outputting the Text between Strings……Page 160
10.2.6 Outputting Text in a Dialect……Page 161
10.3 Streaming Text……Page 162
10.4 Viewing a Character Chart……Page 164
11.1 Choosing the Perfect Text Editor……Page 165
11.2.1 Getting Acquainted with Emacs……Page 167
11.2.2 Basic Emacs Editing Keys……Page 171
11.2.3 Making Abbreviations in Emacs……Page 172
11.2.4 Recording and Running Macros in Emacs……Page 173
11.2.5 Inserting Special Characters in Emacs……Page 174
11.3 Running a Vi Tutorial……Page 176
11.4.1 Cutting Text……Page 177
11.5 Editing Streams of Text……Page 178
11.6 Concatenating Text……Page 179
11.6.1 Writing Text to Files……Page 180
11.6.3 Inserting Text at the Beginning of a File……Page 181
11.7 Including Text Files……Page 182
12.1 Spelling……Page 185
12.1.2 Listing the Misspellings in a Text……Page 186
12.1.3 Keeping a Spelling Word List……Page 187
12.1.4 Interactive Spell Checking……Page 188
12.1.5 Spell Checking in Emacs……Page 189
12.2 Dictionaries……Page 191
12.2.1 Listing Words that Match a Pattern……Page 192
12.2.2 Listing the Definitions of a Word……Page 193
12.2.4 Listing the Antonyms of a Word……Page 194
12.3 Checking Grammar……Page 195
12.3.1 Checking Text for Misused Phrases……Page 196
12.3.2 Checking Text for Doubled Words……Page 197
12.3.3 Checking Text for Readability……Page 198
12.4 Word Lists and Reference Files……Page 199
13.1 Counting Text……Page 202
13.1.2 Counting the Words in a Text……Page 203
13.1.5 Counting Lines per Page in Emacs……Page 204
13.3 Text Relevance……Page 205
13.3.1 Sorting Text in Order of Relevance……Page 206
13.3.2 Listing Relevant Files in Emacs……Page 207
13.4 Finding Anagrams in Text……Page 208
13.6 Text Cut-Ups……Page 209
13.6.2 Making Random Word Cut-Ups……Page 210
13.6.3 Making Cut-Ups in Emacs……Page 211
14.1 Spacing Text……Page 212
14.1.2 Single-Spacing Text……Page 213
14.1.3 Double-Spacing Text……Page 214
14.1.5 Adding Line Breaks to Text……Page 215
14.1.6 Adding Margins to Text……Page 216
14.1.7 Swapping Tab and Space Characters……Page 217
14.2 Paginating Text……Page 218
14.2.3 Options Available When Paginating Text……Page 219
14.3 Underlining Text……Page 220
14.4 Sorting Text……Page 221
14.5 Numbering Lines of Text……Page 223
14.6 Reversing Text……Page 224
15.1 Searching for a Word or Phrase……Page 226
15.2 Regular Expressions–Matching Text Patterns……Page 228
15.2.2 Matching Lines Ending with Certain Text……Page 230
15.2.4 Matching Lines That Contain Any of Some Regexps……Page 231
15.2.7 Matching Lines That Only Contain Certain Characters……Page 232
15.2.9 Finding Patterns in Certain Contexts……Page 233
15.2.11 Regexps for Common Situations……Page 234
15.3.1 Matching Lines in Compressed Files……Page 235
15.4 Outputting the Context of a Search……Page 236
15.5 Searching and Replacing Text……Page 237
15.6.1 Searching Incrementally in Emacs……Page 238
15.6.3 Searching for a Regexp in Emacs……Page 239
15.7 Searching Text in Less……Page 240
16. Typesetting and Word Processing……Page 242
16.1 Choosing the Right Typesetting System for the Job……Page 243
16.2 Converting Plain Text for Output……Page 244
16.2.1 Outputting Text in a Font……Page 245
16.2.2 Outputting Text as a Poster or Sign……Page 246
16.2.3 Outputting Text with Language Highlighting……Page 247
16.2.4 Outputting Text with Fancy Headers……Page 249
16.2.7 Selecting the Pages of Text to Output……Page 250
16.2.8 Additional PostScript Output Options……Page 251
16.3 LyX Document Processing……Page 252
16.3.2 Writing Documents with LyX……Page 253
16.3.3 Learning More about LyX……Page 254
16.4 Typesetting with TeX and Friends……Page 256
16.4.2 Processing TeX Files……Page 257
16.4.3 Processing LaTeX Files……Page 258
16.4.4 Writing Documents with TeX and LaTeX……Page 259
16.4.5 TeX and LaTeX Document Templates……Page 260
16.5 Writing Documents with SGMLtools……Page 261
16.5.1 Elements of an SGML Document……Page 262
16.5.3 Generating Output from SGML……Page 263
16.6 Other Word Processors and Typesetting Systems……Page 264
17.1 X Fonts……Page 266
17.1.1 Selecting an X Font Name……Page 267
17.1.2 Listing Available X Fonts……Page 268
17.2 Console Fonts……Page 269
17.2.2 Displaying the Characters in a Console Font……Page 270
17.3.1 Horizontal Text Fonts……Page 271
17.3.2 Making a Text Banner……Page 272
17.4 Other Font Tools……Page 273
PART FOUR: Images……Page 274
18.1.1 Previewing a DVI File……Page 275
18.1.2 Previewing a PostScript File……Page 276
18.2 Viewing an Image in X……Page 277
18.2.2 Putting an Image in the Root Window……Page 280
18.3 Browsing Images in a Console……Page 281
18.5 Browsing PhotoCD Archives……Page 282
18.6 Additional Image Viewers……Page 283
19.1 Transforming Images……Page 284
19.1.1 Changing the Size of an Image……Page 285
19.1.3 Adjusting the Colors of an Image……Page 288
19.1.4 Annotating an Image……Page 290
19.1.5 Adding Borders to an Image……Page 291
19.1.7 Combining Images……Page 292
19.1.8 Morphing Two Images Together……Page 293
19.2 Converting Images between Formats……Page 294
19.3 Editing Images with the GIMP……Page 296
19.4 Interactive Image Editors and Tools……Page 297
20.1.1 Taking a Screen Shot in X……Page 299
20.1.2 Taking a Screen Shot in a Console……Page 300
20.2.1 Listing Available Scanner Devices……Page 301
20.2.3 Scanning an Image……Page 302
20.3 Extracting PhotoCD Images……Page 303
20.3.2 Removing PhotoCD Haze……Page 304
21. PostScript……Page 306
21.1.2 Extracting Pages from a PostScript File……Page 307
21.1.3 Combining PostScript Pages……Page 309
21.2 Manipulating PostScript Documents……Page 310
21.2.2 Combining PostScript Documents……Page 311
21.2.3 Arranging a PostScript Document in a Booklet……Page 312
21.3.2 Converting PostScript to Plain Text……Page 313
PART FIVE: Sound……Page 315
22.1 Sound File Formats……Page 316
22.2.1 Listing the Current Audio Settings……Page 317
22.2.2 Changing the Volume Level……Page 318
22.2.4 Selecting an Audio Recording Source……Page 319
22.3 Playing a Sound File……Page 320
22.3.2 Playing a MIDI File……Page 321
22.4 Recording a Sound File……Page 322
22.5 Other Sound File Tools……Page 323
23.1 Controlling CD Audio……Page 325
23.1.2 Pausing an Audio CD……Page 326
23.1.4 Shuffling Audio CD Tracks……Page 327
23.1.5 Displaying Information about an Audio CD……Page 328
23.2 Sampling Sound from a CD……Page 329
23.3 Writing an Audio CD-R……Page 330
23.4 Other Audio CD Applications……Page 332
24.1 Working with Selections from Sound Files……Page 333
24.1.2 Pasting a Selection of Sound……Page 334
24.2 Sound Effects……Page 335
24.2.1 Changing the Amplitude of a Sound File……Page 336
24.2.4 Adding Echo to a Sound File……Page 337
24.2.6 Adding Phase to a Sound File……Page 338
24.2.8 Adding Vibro-Champ Effects to a Sound File……Page 339
24.3 Converting Sound Files……Page 340
24.3.1 Making an MP3 File……Page 341
24.4 Other Tools for Sound Editing……Page 342
PART SIX: Productivity……Page 344
25.1 Listing a Disk’s Free Space……Page 345
25.2 Listing a File’s Disk Usage……Page 346
25.3 Floppy Disks……Page 347
25.3.2 Mounting a Floppy Disk……Page 348
25.4 CD-ROMs……Page 349
25.4.1 Mounting a CD-ROM……Page 350
25.4.2 Unmounting a CD-ROM……Page 351
26. Printing……Page 352
26.1.1 Sending a Print Job to the Printer……Page 353
26.1.3 Listing Your Print Jobs……Page 354
26.1.4 Cancelling a Print Job……Page 355
26.2.1 Printing in Emacs……Page 356
26.2.2 Printing with Dvips……Page 357
26.3 Preparing Files for Printing……Page 358
26.3.1 Preparing a PostScript File for Printing……Page 359
26.3.2 Preparing a DVI File for Printing……Page 360
26.3.3 Preparing a PDF File for Printing……Page 361
26.3.4 Preparing a Man Page for Printing……Page 362
27.1 Using DOS and Windows Disks……Page 363
27.1.2 Copying Files to and from a DOS Disk……Page 364
27.2 Using Macintosh Disks……Page 365
27.2.2 Listing the Contents of a Macintosh Disk……Page 366
27.2.4 Deleting Files on a Macintosh Disk……Page 367
27.2.5 Formatting a Macintosh Disk……Page 368
27.3 Converting Text Files between DOS and Linux……Page 369
27.4.1 Converting Word to LaTeX……Page 370
27.4.2 Converting Word to Plain Text……Page 371
28.1 Displaying the Date and Time……Page 372
28.2 Playing an Audible Time Announcement……Page 373
28.3.1 Displaying a Calendar……Page 374
28.4 Managing Appointments……Page 376
28.4.1 Making an Appointment File……Page 377
28.4.2 Including Holidays in Your Reminders……Page 378
28.4.3 Automatic Appointment Delivery……Page 379
28.5.1 Keeping a Free-Form Address List……Page 380
28.5.2 Keeping a Contact Manager Database……Page 382
28.6.1 Sending Yourself Email Reminders……Page 383
28.6.3 Running a Command on a Delay……Page 384
29.1.1 Making a Quick Arithmetic Calculation……Page 386
29.1.2 Making Many Arithmetic Calculations……Page 387
29.3 Listing a Sequence of Numbers……Page 389
29.4 Finding Prime Factors……Page 390
29.5.1 Converting an Amount between Units of Measurement……Page 391
29.6 Other Math Tools……Page 392
PART SEVEN: Networking……Page 394
30.1 Connecting to the Internet……Page 395
30.1.1 Setting Up PPP……Page 396
30.1.2 Controlling a PPP Connection……Page 397
30.2 Faxing……Page 398
30.2.1 Sending a Fax……Page 399
30.2.3 Receiving Faxes Automatically……Page 400
30.2.4 Converting to and from Fax Format……Page 401
30.3 Calling Out on a Modem……Page 402
31.1 Sending Mail……Page 404
31.1.1 Mailing a User on the Same System……Page 405
31.1.3 Mailing the Contents of a URL……Page 406
31.1.4 Special Mail Composition Keystrokes……Page 407
31.2 Receiving Mail……Page 408
31.2.1 Deleting Mail……Page 409
31.3 Managing Mail……Page 410
31.3.2 Setting Notification for New Mail……Page 411
31.3.4 Seeing Who Your Mail Is From……Page 413
31.4 Mail Attachments……Page 414
31.4.2 Sending a Mail Attachment……Page 415
31.5 Making an Email Signature……Page 416
31.6 Picking the Right Mail Application……Page 417
32.1 Browsing the Web……Page 419
32.1.1 Maintaining a List of Visited Web Sites……Page 421
32.1.3 Mozilla Browsing Tips……Page 422
32.3 Reading Text from the Web……Page 423
32.3.1 Perusing Text from the Web……Page 425
32.3.3 Options Available while Browsing Text……Page 426
32.4 Browsing the Web in Emacs……Page 427
32.5 Getting Files from the Web……Page 429
32.5.2 Archiving an Entire Web Site……Page 430
32.5.3 Archiving Part of a Web Site……Page 431
32.6 Writing HTML……Page 432
32.6.1 Adding Parameters to Image Tags……Page 433
32.6.2 Converting HTML to Another Format……Page 434
32.7 More Web Browsers and Tools……Page 435
33.1 Connecting to Another System……Page 437
33.1.2 Connecting to Another System with Encryption……Page 439
33.2 Transferring Files with Another System……Page 440
33.2.1 Uploading a File……Page 441
33.2.2 Downloading a File……Page 442
33.3 Reading Usenet……Page 443
33.3.1 Choosing a Newsreader……Page 444
33.4 Listing Online System and User Activity……Page 445
33.4.2 Checking Whether a User Is Online……Page 446
33.4.3 Listing Who Is Logged In to a System……Page 447
33.4.5 Finding the Host Name of an IP Address……Page 448
33.5 Sending a Message to Another User’s Terminal……Page 449
33.6.1 Chatting Directly with a User……Page 451
33.6.2 Chatting with Users on IRC……Page 453
33.6.3 Chatting with Users on ICQ……Page 454
A.1 Linux and Hardware Compatibility……Page 455
A.2 Shutting Down the System……Page 456
A.2.2 Shutting Down at a Certain Time……Page 457
A.2.3 Cancelling a Shutdown……Page 458
A.3.2 Installing a Debian Package……Page 459
A.3.3 Upgrading a Debian Package……Page 460
A.3.4 Installing a Shell Script……Page 461
A.4 Administrating Users……Page 462
A.4.3 Letting Users Mount Drives……Page 463
A.5.1 How Long Has the System Been Up?……Page 464
A.5.2 What Version of Linux Am I Running?……Page 465
A.5.3 What Version of Debian Am I Running?……Page 466
B. Linux Resources on the Web……Page 467
C.1 Design Science License……Page 469
C.2 Applying Copyleft to Your Work……Page 472
(1)……Page 474
(2)……Page 494
(11)……Page 521
(21)……Page 522
(30)……Page 523
(39)……Page 524
Footnotes……Page 525
Table of Contents……Page 526
Short Table of Contents……Page 543
About this document……Page 544
Reviews
There are no reviews yet.