Unix concepts and applications

Das, Sumitabha

Unix concepts and applications Sumitabha Das - 4th ed. - New Delhi : Tata Mc GRaw Hill , 2006. - xviii, 671 p. ill. ;

includes appendix and index

CHAPTER 1
1.1 The Operating System 4
1.2 The UNIX Operating System
1.3 Knowing \bur Machine 6
1.4 A Brief Session 7
1.5 How It All Clicked 15
1.6 Linux and GNU 17
1.7 Conclusion 18
Wrap Up 18
Test Your Understanding 19
Flex Your Brain 19
CHAPTER 2
2.1 The UNIX Architecture 22
2.2 Features of UNIX 25
2.3 POSIX and the Single UNIX Specification 27
2.4 Locating Commands 28
2.5 Internal and External Commands 29
2.6 Command Structure 30
2.7 Flexibility of Command Usage 32
2.8 Man Browsing the Manual Pages On-line 33
2.9 Understanding the man Documentation 34
2.10 Further Help with man -k, apropos and whatis 37
2.11 When Things Go Wrong 39
2.12 Conclusion 41
Wrap Up 41
Test Your Understanding 42
Flex Your Brain 43
CHAPTER OTNERAl-PtJRPOSE UTILmES
3.1 cal: The Calendar 45
3.2 date: Displaying the System Date 45
3.3 echo: Displaying a Message 46
3.4 printf: An Alternative to echo 48
3.5 be: The Calculator 49
3.6 script: Recording\bur Session 50
3.7 Email Basics 51
3.8 mailx: The Universal Mailer 52
3.9 passwd: Changing "Vfour Password 55
3.10 who: Who Are the Users.? 57
3.11 unaroe: Knowing \bur Machine's Characteristics 58
3.12 tty: Knowing "Ifour Terminal 59
3.13 stty: Displaying and Setting Terminal Characteristics 59
3.14 Conclusion 61
Wrap Up 61
Test Your Understanding 62
Flex Your Brain 62
CHAPTER 4 THE FILE SYSTEM
4.1 The File 65
4.2 What's in a (File)name.? 67
4.3 The Parent-Child Relationship 67
4.4 The HOME Variable: The Home Directory 68
4.5 pwd: Checking \bur Current Directory 69
4.6 cd: Changing the Current Directory 69
4.7 mkdir: Making Directories 71
4.8 rmdir: Removing Directories 71
4.9 Absolute Pathnames 73
4.10 Relative Pathnames 74
4.11 Is: Listing Directory Contents 75
4.12 The UNIX File System 79
4.13 Conclusion 80
Wrap Up 80
Test Your Understanding 80
Flex Your Brain 81
■»
CHAPTER5
5.1 cat: Displaying and Creating Files 83
5.2 cp: Copying a File 84
5.3 rm: Deleting Files 85
5.4 mv: Renaming Files 87
5.5 more: Paging Output 88
5.6 The Ip Subsystem: Printing a File 91
5.7 file: Knowing the File Types 92
5.8 wc: Counting Lines, Words and Characters 93
5.9 od: Displaying Data in Octal 94
5.10 cmp: Comparing Two Files 95
5.11 coram: What is Common.? 95
5.12 diff: Converting One File to Other 96
5.13 dos2unix and unix2dos: Converting Between DOS and UNIX 97
5.14 Compressing and Archiving Files 98
5.15 gzip and gunzip: Compressing and Decompressing Files 99
5.16 tar: The Archival Program 100
5.17 zip and unzip: Compressing and Archiving Together 102
5.18 Conclusion 103

V7rap Up 103
Test Your Understanding 104
Flex Your Brain 104
CHAPTER 6
6.1 Is -1: Listing File Attributes 106
6.2 The-d Option: Listing Directory Attributes 108
6.3 File Ownership 109
6.4 File Permissions 109

6.5 chmod: Changing File Permissions 110
6.6 Directory Permissions 115
6.7 Changing File Ownership 116
6.8 Conclusion 117
Wrap Up 117
Test Your Understanding 118
Flex Your Brain 119
CHAPTER 7THE.< EDITOR
7.1 vi Basics 121
7.1 Input Mode—Entering and Replacing Text 124
■'
7.3 Saving Text and Quitting—^The ex Mode 128
7.4 Navigation 131
7.5 Editing Text 134
7.6 Undoing Last Editing Instructions (U and U) 137
7.7 Repeating the Last Command (.) 138
7.8 Searching for a Pattern (/ and ?) 138
7.9 Substitution—Search and Replace (;s) 140
7.10 Conclusion 141
Wrap Up 141
Test Your Understanding 142
Flex Your Brain 143
8.1 The Shell's Interpretive Cycle 146
8.2 Shell Offerings 147
8.3 Pattern Matching—^The Wild-cards 147
8.4 Escaping and Quoting 152
8.5 Redirection; The Three Standard Files 154
8.6 /dev/nuU and/dev/tty: Two Special Files 160
8.7 Pipes 161
8.8 tee: Creating a Tee 164
8.9 Command Substitution 165
8.10 Shell Variables 166
8.11 Conclusion 169
Wrap Up 170
Test Your Understanding 170
Flex Your Brain 171
9.1 Process Basics 174
9.2 ps: Process Status 176
9.3 System Processes (-0 or-a) 178
9.4 Mechanism of Process Creation 179
9.5 Internal and External Commands 181
9.6 Process States and Zombies 181
9.7 Running Jobs in Background ,182
9.8 nice: Job Execution with Low Priority 183
9.9 Killing Processes with Signals 184
9.10 Job Control 185
9.11 at and batch: Execute Later 187
9.12 cron: Running Jobs Periodically 188
9.13' time: Timing Processes 190
9.14 Conclusion 190
Wrap Up 190
Test Your Understanding 191
Flex Your Brain 192
jHAmRiP.aiiroMEiNG.iim
10.1 The Shells 194
10.2 Environment Variables 194
10.3 The Common Environment Variables 195
10.4 Aliases (bash and ksh) 199
10.5 Command History (bash and ksh) 200
10.6 In-line Command Editing (bash and ksh) 203
10.7 Miscellaneous Features (bash and ksh) 204
10.8 The Initialization Scripts 205
10.9 Conclusion 207
Wrap Up 208
Test Your Understanding 208
Flex Your Brain 209
11.1 File Systems and Inodes 211
11.2 Hard Links 212
11.3 Symbolic Links and 1 n 215
11.4 The Directory 216
11.5 umask: Default File and Directory Permissions 218
11.6 Modification and Access Times 218
11.7 find: Locating Files 220
11.8 Conclusion 224
Wrap Up 224
Test Your Understanding 225
Flex Your Brain 226
CHAPTER 12 SIMPLE FILTERS
12.1 The Sample Database 228
12.2 pr: Paginating Files 229
12.3 head: Displaying the Beginning of a File 230
12.4 tail: Displaying the End of a File 231
12.5 cut: Slitting a File Vertically 231
12.6 paste: Pasting Files 233
12.7 sort: Ordering a File 234
12.8 uniq: Locate Repeated and Nonrepeated Lines 238
12.9 tr: Translating Characters 239
12.10 An Example: Displaying a Word-count List 241
12.11 Conclusion 242
Wrap Up 242
Test Your Understanding 243
Flex Your Brain 243
-ILTEBS.tJSING BEQULAR EXPRE^IONS^rep^.wl
13.1 grep: Searching for a Pattern 246
13.2 Basic Regular Expressions (BRE)—^An Introduction 249
13.3 Extended Regular Expressions (ERE) and egrep 254
13.4 sed: The Stream Editor 255
13.5 Line Addressing 256
13.6 Using Multiple Instructions (-E and -F) 257
13.7 Context Addressing 258
13.8 Writing Selected Lines to a File (w) 258
13.9 Text Editing 259
13.10 Substitution (s) 260
13.11 Basic Regular Expressions Revisited 263
13.12 Conclusion 266
Wrap Up 266
Test Your Understanding 267
Flex Your Brain 268

CHAPTER 14
14.1 Shell Scripts 271
14.2 read: Making Scripts Interactive 272
14.3 Using Command Line Arguments 273
14.4 exit and Exit Status of Command 275
14.5 The Logical Operators && and 1 1—Conditional Execution 276
14.6 The i f Conditional 277
14.7 Using test and [] to Evaluate Expressions 278
14.8 The case Conditional 283
14.9 expr: Computation and String Handling 285
14.10 $0: Calling a Script by Different Names 288
14.11 while: Looping 289
14.12 for: Looping with a List 291
14.13 set and shift: Manipulating the Positional Parameters 294
14.14 The Here Document («) 296
14.15 trap: Interrupting a Program 297
14.16 Debugging Shell Scripts with set -x 298
14.17 Sample Validation and Data Entry Scripts 299
14.18 Conclusion 302
W I, d# H! I H
Wrap Up 302
Test Your Understanding 303
Flex Your Brain 303
CHAPTER 15
15.1 root: The System Administrator's Login 306
15.2 The Administrator's Privileges 307
15.3 Maintaining Security 308
15.4 User Management 311
15.5 Startup and Shutdown 313
15.6 Managing Disk Space 315
15.7 Device Files 317
15.8 Handling Floppy Diskettes 319
15.9 cpio: A Backup Program 321
15.10 tar: The "Tape" Archive Program 325
15.11 Conclusion 328
Wrap Up 328 '
Test Your Understanding 329
Flex Your Brain 330
^&TER X WINDOW system
16.1 X Basics 334
PART II
CHAPTER 16
16.2 The Common Desktop Environment (CDE) 336
16.3 Starting and Quitting X 338
16.4 The Terminal Emulator 338
16.5 Cut-and-Paste Operations 339
16.6 Running X Clients Remotely 341
16.7 Command Line Options 343
16.8 Some Standard X Clients 344
16.9 The Startup Files 347
16.10 X Resources 348
16.11 Conclusion 349
Wrap Up 349
Test Your Understanding 350
Flex Your Brain 350
CHAPTER 17
17.1 TCP/IP Basics 352
17.2 Resolving IP Addresses 354
17.3 The Applications 355
17.4 ping: Checking the Network 356
17.5 telnet: Remote Login 356
17.6 ftp: File Transfer Protocol 357
17.7 Cryptography Basics 360
17.8 SSH: The Secure Shell 362
17.9 The SSH Tools 366
17.10 The Domain Name System (DNS) 368
17.11 Internet Mail 370
17.12 MIME: Handling Binary Attachments in Mail 372
17.13 The World Wide Web 373
17.14 Multimedia on the Web: MIME Revisited 377
17.15 Conclusion 378
Wrap Up 378
Test Your Understanding 379
Flex Your Brain 380
CHAPTER 18
18.1 Simple awk Filtering 382
18.2 Splitting a Line into Fields 383
18.3 pri ntf: Formatting Output 384
18.4 Variables and Expressions 384
18.5 The Comparison Operators 385
18.6 Number Processing 388
18.7 Variables 388
18.8 The -f Option: Storing awk Programs in a File 388
18.9 The BEGIN and END Sections 389
18.10 Built-in Variables 390





perl Preliminaries
The chop Function: Removing the Last Character 403
Variables and Operators 404
The String Handling Functions 405
Specifying Filenames in Command Line 406
: The Default Variable 407
Current Line Number ($.) and the Range Operator (..)
Lists and Arrays 408
for each: Looping Through a List 412
spl i t: Splitting into a List or Array 413
join: Joining a List 415
dec Zbi n. pi: Converting a Decimal Number to Binary 416
grep: Searching an Array for a Pattern 416
Associative Arrays 417
Regular Expressions and Substitution 420
File Handling 423
File Tests 425
Subroutines 426
Conclusion 427
Wrap Up 427
Test Your Understanding 428
Flex Your Brain 429
Operators 431
PPiP
mmm
The ex Mode: Handling Multiple Files 435
Named Buffers: Storing Multiple Text Sections 437
Numbered Buffers': Undoing Multiple Line Deletions 438

20.5 Entering Control Characters (/C/rZ-fc-y) 439
20.6 Searching for a Character 439
20.7 Marking Text 440
20.8 Customizing vi 440
20.9 Conclusion 444

Test Your Understanding 444
Flex Your Brain 445
CHAPTER212
a)VANCED SHELL PROGRAMMING
21.1 Shells and Sub-shells 447
21.2 0 and : Sub-shell or Current Shell.? 447
21.3 export: Exporting Shell Variables 448
21.4 Running a Script in the Current Shell: The . Command 449
21.5 let: Computation—a Second Look (Korn and Bash) 450
21.6 Arrays (Korn and Bash) 450
21.7 String Handling (Korn and Bash) 452
21.8 Conditional Parameter Substitution 453
21.9 Merging Streams 455
21.10 Shell Functions 456
21.11 eval: Evaluating Twice 459
21.12 The exec Statement 461
21.13 Conclusion 464
Wrap Up 464
Test Your Understanding 464
Flex Your Brain 465

22.1 Handling Multisource C Applications 466
22.2 A Multisource Application 467
22.3 make: Keeping Programs Up-to-date 471
22.4 ar: Building a Library (Archive) 475
22.5 Static and Shared Libraries 477
22.6 Version Control With SCCS and RCS 478
22.7 An SCCS Session 479
22.8 Activity and History Information 483
22.9 Continuing Editing with SCCS 484
22.10 The Revision Control System (RCS) 486
22.11 Conclusion 490
Wrap Up 490
Test Your Understanding 490
Flex Your Brain 491
23.1 System Call Basics 493
23.2 Opening and Closing a File 495
23.3 Using the I/O Calls 497
23.4 Buffered and Unbuffered I/O 502
23.5 umask: Modifying File Permissions During Creation 503
23.6 Handling Errors 504
23.7 File Sharing 509
23.8 Directory Navigation 512
23.9 Reading a Directory 513
23.10 Modifying Entries in Directory 514
23.11 Reading the Inode: stat 516
23.12 Checking a File's Access Rights 521
23.13 Modifying File Attributes 526
23.14 Conclusion 529
Wrap Up 530
Test Your Understanding 531
Flex Your Brain 532
24.1 Process Abstractions 534
24.2 process.c: Looking Up Some Process Credentials 536
24.3 Creating a Process 537
24.4 _exit and exit: Process Termination 540
24.5 Waiting to Pick Up Child's Exit Status 542
24.6 Process Groups 545
24.7 Zombies and Orphans 545
24.8 exec: The Final Step in Process Creation 546
24.9 she! 1 .c: A Program with a Shell-like Capability 551
24.10 File Descriptor Manipulation 553
24.11 pipe: Inter-process Communication 557
24.12 Signal Handling 560
24.13 signal: Installing a Signal Handler 563
24.14 killprocess.c: The Final Program Using kill 566
24.15 Conclusion 569


Partitions and File Systems 574
The Standard File Systems and Their Types 577
fdisk: Creating Partitions 578
mkfs: Creating a File System 580
Mounting and Unmounting File Systems 580
f sck: File System Checking 583
System Startup and init 585
Shutdown and the sync Operation 589
25.10 Backups 589
25.11 Conclusion 591
Wrap Up 591
Test Your Understanding 592
Flex Your Brain 593


9780070635463 (pb)


Computer Programming

005.13 / DAS/U
SIKKIM UNIVERSITY
University Portal | Contact Librarian | Library Portal

Powered by Koha