Preface |
|
xvii | |
Acknowledgments |
|
xxiii | |
Author |
|
xxv | |
Section I Linux Concept |
|
|
|
3 | (32) |
|
1.1 Getting Started with OS |
|
|
3 | (1) |
|
1.2 A Brief Overview of Unix and Linux |
|
|
4 | (1) |
|
|
5 | (3) |
|
|
8 | (2) |
|
1.4.1 Open-Source Software |
|
|
9 | (1) |
|
1.5 Features and Advantages of Linux |
|
|
10 | (2) |
|
|
11 | (1) |
|
|
12 | (1) |
|
1.7 Installation Procedure and Issues |
|
|
12 | (3) |
|
|
12 | (1) |
|
1.7.2 Key Issues to Install Linux |
|
|
13 | (1) |
|
1.7.3 Key Steps of Linux Installation |
|
|
14 | (1) |
|
|
15 | (1) |
|
1.9 Shell and Its Features |
|
|
16 | (2) |
|
1.10 An Overview of Kernels |
|
|
18 | (3) |
|
|
19 | (1) |
|
|
20 | (1) |
|
1.11 The GNOME and KDE Desktops |
|
|
21 | (1) |
|
1.11.1 The Window Manager for GUI |
|
|
21 | (1) |
|
|
21 | (1) |
|
|
22 | (1) |
|
|
22 | (2) |
|
|
23 | (1) |
|
1.13 Linux Interface: GUI and CUI |
|
|
24 | (2) |
|
|
26 | (4) |
|
|
26 | (1) |
|
|
27 | (2) |
|
|
29 | (1) |
|
|
29 | (1) |
|
1.15 Start-Up Scripts and Run Levels |
|
|
30 | (1) |
|
|
30 | (1) |
|
1.15.2 Run Levels (Mit, inittab, and rc Files) |
|
|
30 | (1) |
|
|
31 | (1) |
|
|
31 | (2) |
|
|
33 | (2) |
|
|
35 | (20) |
|
2.1 Command Syntax, Options, and Arguments |
|
|
36 | (2) |
|
2.2 Internal and External Commands |
|
|
38 | (1) |
|
2.3 Command Location and User Commands |
|
|
39 | (5) |
|
|
44 | (1) |
|
|
44 | (1) |
|
|
44 | (1) |
|
2.4 Communication and Other Commands |
|
|
44 | (7) |
|
|
51 | (1) |
|
|
52 | (1) |
|
|
53 | (2) |
|
|
55 | (34) |
|
|
55 | (1) |
|
3.2 Why Use a Shell in Linux? |
|
|
56 | (1) |
|
3.3 The Login Shell (Shell Prompt) |
|
|
56 | (1) |
|
3.4 Command Line Structure of Shells |
|
|
57 | (1) |
|
|
58 | (1) |
|
3.6 Basics and Interpretive Cycle of Shells |
|
|
59 | (1) |
|
3.7 Starting a Terminal Shell |
|
|
60 | (1) |
|
3.8 Shell Variables: User-Defined and Predefined |
|
|
61 | (7) |
|
|
61 | (3) |
|
|
64 | (4) |
|
|
64 | (1) |
|
3.8.2.2 Creating and Setting User-Defined Variables: =, $, set(export), unset |
|
|
64 | (2) |
|
3.8.2.3 How to Set a Local variable into a Global Environment Variable |
|
|
66 | (1) |
|
3.8.2.4 How to Unset a Local Variable from a Global Environment Variable |
|
|
67 | (1) |
|
3.8.2.5 How to Set the PATH Environment Variable |
|
|
67 | (1) |
|
|
68 | (3) |
|
|
69 | (1) |
|
3.9.2 Bourne Again Shell (bash) |
|
|
69 | (2) |
|
|
71 | (5) |
|
|
72 | (1) |
|
|
73 | (1) |
|
|
73 | (1) |
|
3.10.4 Condition Commands |
|
|
74 | (2) |
|
3.11 Standard Input/Output Redirection |
|
|
76 | (2) |
|
|
78 | (1) |
|
|
78 | (1) |
|
|
79 | (1) |
|
3.15 Backslash (\) and Quotes |
|
|
80 | (2) |
|
3.16 Building Shell Commands |
|
|
82 | (1) |
|
|
83 | (1) |
|
|
84 | (1) |
|
|
85 | (2) |
|
|
87 | (2) |
|
|
89 | (30) |
|
|
89 | (2) |
|
|
89 | (2) |
|
|
91 | (2) |
|
4.3 Start, Edit, and Close Files |
|
|
93 | (2) |
|
|
94 | (1) |
|
4.3.2 Saving Your Work and Quitting |
|
|
94 | (1) |
|
4.3.3 Open and Recover File from a Crash (:recover and -r) |
|
|
94 | (1) |
|
|
95 | (6) |
|
|
96 | (1) |
|
4.4.2 Inserting or Appending Text |
|
|
96 | (1) |
|
|
97 | (1) |
|
|
97 | (1) |
|
|
98 | (1) |
|
|
98 | (2) |
|
4.4.7 Cutting, Pasting, and Copying Text |
|
|
100 | (1) |
|
|
101 | (4) |
|
|
105 | (2) |
|
|
107 | (3) |
|
4.8 vim (vi Improved) and nvi (New vi) |
|
|
110 | (2) |
|
|
112 | (1) |
|
4.9.1 Key Features of gedit |
|
|
112 | (1) |
|
4.10 Emacs Editor and Commands |
|
|
113 | (3) |
|
4.10.1 Starting and Quitting emacs |
|
|
114 | (2) |
|
|
116 | (1) |
|
|
116 | (2) |
|
|
118 | (1) |
|
5 Regular Expressions and Filters |
|
|
119 | (30) |
|
|
119 | (1) |
|
5.1.1 What's the Variance between BRE and ERE? |
|
|
120 | (1) |
|
5.1.2 Meaning of Various Characters and Metacharacters in Regular Expressions |
|
|
120 | (1) |
|
|
120 | (7) |
|
5.2.1 grep Associated with Exit Status |
|
|
123 | (4) |
|
5.3 Other Regular Filters (with Examples) |
|
|
127 | (17) |
|
5.3.1 cat: Concatenate Files and Display the File Contents |
|
|
127 | (2) |
|
5.3.2 The comm Command: to Compare Two Sorted Files Line by Line |
|
|
129 | (1) |
|
5.3.3 The cut Command: Remove Sections from Each Line of Files |
|
|
130 | (1) |
|
5.3.4 The expand Command: to Convert Tabs into Spaces |
|
|
130 | (1) |
|
5.3.5 The compress Command: to Compress Data |
|
|
131 | (1) |
|
5.3.6 The fold Command: to Break Each Line of Input Text to Fit in Specified Line Width |
|
|
131 | (1) |
|
5.3.7 The head Command: to Display the Starting Part of File |
|
|
132 | (1) |
|
5.3.8 The more Command: File Checking Filter for Control Viewing |
|
|
133 | (1) |
|
5.3.9 The less Command: to Scroll and View Text |
|
|
133 | (1) |
|
5.3.10 The nl Command: to Number the Lines in a File |
|
|
134 | (2) |
|
5.3.11 Perl: Practical Extraction and Report Language |
|
|
136 | (1) |
|
5.3.12 The pr Command: Formatting Text Files for Printing |
|
|
136 | (1) |
|
5.3.13 The split Command: to Break a File into Parts |
|
|
136 | (1) |
|
5.3.14 The strings Command: to Print the Strings of Printable Characters in Files |
|
|
137 | (1) |
|
5.3.15 The tail Command: to Display the Ending Part of a File |
|
|
138 | (1) |
|
5.3.16 The tac Command: to Concatenate and Print Files in Reverse |
|
|
139 | (1) |
|
5.3.17 The tee Command: to Duplicate Standard Input |
|
|
140 | (1) |
|
5.3.18 The tr Command: to Translate Characters |
|
|
141 | (1) |
|
5.3.19 The uniq Command: to Report or Omit Repeated Lines |
|
|
141 | (1) |
|
5.3.20 The sort Command: to Sort Lines of a Text File |
|
|
142 | (1) |
|
5.3.21 The we Command: to Count Lines, Words, and Characters |
|
|
142 | (1) |
|
5.3.22 The zcat Command: to Display Contents of Compressed Files |
|
|
143 | (1) |
|
|
144 | (1) |
|
|
145 | (3) |
|
|
148 | (1) |
|
|
149 | (26) |
|
6.1 Pattern-Matching Programming Language |
|
|
149 | (1) |
|
|
150 | (1) |
|
6.3 Basic Syntax and Addressing of sed |
|
|
151 | (2) |
|
|
153 | (1) |
|
|
154 | (12) |
|
6.5.1 Substitute Patterns |
|
|
156 | (1) |
|
6.5.2 Replacement Characters |
|
|
157 | (1) |
|
6.5.3 Append, Insert, and Change |
|
|
158 | (4) |
|
6.5.4 The Delete Command and the Use of the Exclamation Sign (!) |
|
|
162 | (3) |
|
6.5.5 The Transform Command |
|
|
165 | (1) |
|
6.5.6 Pattern and Hold Spaces |
|
|
165 | (1) |
|
|
166 | (1) |
|
6.6 Advanced sed Commands |
|
|
166 | (4) |
|
|
170 | (1) |
|
|
171 | (1) |
|
|
171 | (1) |
|
|
172 | (2) |
|
|
174 | (1) |
|
|
175 | (32) |
|
7.1 Awk Introduction and Concept |
|
|
175 | (1) |
|
7.2 Awk Features over Sed |
|
|
176 | (1) |
|
7.3 Structure of an AWK Program |
|
|
177 | (1) |
|
7.4 Writing and Executing AWK Program |
|
|
178 | (2) |
|
7.4.1 To Make Executable awk Programs |
|
|
179 | (1) |
|
7.4.2 Standard Options with awk |
|
|
179 | (1) |
|
7.5 Awk Patterns and Actions |
|
|
180 | (2) |
|
|
180 | (1) |
|
|
181 | (1) |
|
7.6 BEGIN and END Patterns |
|
|
182 | (1) |
|
|
182 | (1) |
|
|
183 | (2) |
|
7.9 Simple Output from AWK |
|
|
185 | (4) |
|
7.9.1 The print Statement |
|
|
185 | (4) |
|
|
189 | (2) |
|
|
191 | (1) |
|
7.11 Arithmetic and Variables |
|
|
191 | (3) |
|
|
191 | (1) |
|
|
192 | (2) |
|
|
194 | (2) |
|
|
196 | (1) |
|
|
197 | (1) |
|
|
198 | (2) |
|
7.15.1 Multidimensional Arrays |
|
|
199 | (1) |
|
|
200 | (1) |
|
|
200 | (2) |
|
|
202 | (1) |
|
|
203 | (2) |
|
|
205 | (2) |
|
|
207 | (38) |
|
|
207 | (1) |
|
|
208 | (1) |
|
8.3 Making a Script Executable: chmod |
|
|
209 | (2) |
|
8.3.1 Path of Script File |
|
|
210 | (1) |
|
8.4 Interactive Script: Read |
|
|
211 | (2) |
|
|
213 | (5) |
|
8.5.1 Positional Parameter Variable: Command-Line Arguments |
|
|
213 | (3) |
|
8.5.2 Environment Variable |
|
|
216 | (2) |
|
|
218 | (4) |
|
8.6.1 Arithmetic Operator |
|
|
221 | (1) |
|
|
222 | (1) |
|
8.6.3 Conditional Operator |
|
|
222 | (1) |
|
|
222 | (8) |
|
|
223 | (1) |
|
8.7.2 if then else Statement |
|
|
224 | (1) |
|
|
225 | (1) |
|
|
225 | (1) |
|
8.7.5 Loop (for) Statement |
|
|
225 | (3) |
|
8.7.6 switch/case Statement |
|
|
228 | (2) |
|
|
230 | (1) |
|
|
230 | (4) |
|
8.10 Advanced Shell Scripting |
|
|
234 | (4) |
|
|
234 | (3) |
|
|
237 | (1) |
|
8.11 Examples of Shell Scripting Program |
|
|
238 | (2) |
|
|
240 | (1) |
|
|
241 | (2) |
|
|
243 | (2) |
|
9 Linux System Administration |
|
|
245 | (36) |
|
|
245 | (2) |
|
|
247 | (1) |
|
9.3 Kernel Administration |
|
|
248 | (3) |
|
9.3.1 Listing Kernel Modules with lsmod |
|
|
250 | (1) |
|
9.4 Compiling and Installing |
|
|
251 | (4) |
|
|
255 | (1) |
|
|
256 | (4) |
|
|
256 | (2) |
|
9.6.2 GRand Unified Boot loader |
|
|
258 | (2) |
|
|
260 | (3) |
|
|
263 | (4) |
|
9.8.1 Red Hat Package Manager |
|
|
264 | (3) |
|
9.8.2 Installation and Uninstallation |
|
|
267 | (1) |
|
|
267 | (2) |
|
9.10 Installing and Managing Software on RPM-Based Systems |
|
|
269 | (1) |
|
9.11 Installing Programs from Source Code |
|
|
269 | (3) |
|
9.12 Network Management: telnet, rlogin, and rdesktop Commands |
|
|
272 | (3) |
|
9.12.1 Connect Windows desktop from Linux system |
|
|
275 | (1) |
|
|
275 | (1) |
|
|
276 | (1) |
|
|
277 | (4) |
Section II Linux Programming |
|
|
|
281 | (40) |
|
|
281 | (2) |
|
|
283 | (1) |
|
|
283 | (1) |
|
10.2 Linux File System Architecture |
|
|
283 | (1) |
|
10.3 File and Directory Structure |
|
|
284 | (4) |
|
10.3.1 Root (/) Directory |
|
|
284 | (1) |
|
|
285 | (1) |
|
|
286 | (1) |
|
10.3.4 System Directories |
|
|
286 | (2) |
|
|
288 | (1) |
|
|
288 | (11) |
|
10.5.1 Creating files: touch, cat |
|
|
289 | (2) |
|
|
291 | (1) |
|
10.5.3 Displaying Files: cat, more, head, and less: |
|
|
292 | (2) |
|
10.5.4 Printing Files: lpr, lpq, and lprm |
|
|
294 | (2) |
|
10.5.5 Searching and Linking File: find, In |
|
|
296 | (3) |
|
|
299 | (7) |
|
10.6.1 Special Directories |
|
|
299 | (1) |
|
10.6.2 Paths and Pathnames: Absolute, Relative |
|
|
300 | (1) |
|
10.6.3 Creating and Deleting Directories mkdir, rmdir |
|
|
300 | (2) |
|
10.6.4 Displaying Directory Contents: is |
|
|
302 | (1) |
|
10.6.5 Moving through Directories cd |
|
|
303 | (1) |
|
10.6.6 Locate Directory: pwd |
|
|
303 | (1) |
|
10.6.7 Scanning Directories: opendir, readdir, telldir, seekdir, and closedir |
|
|
304 | (2) |
|
10.7 Archiving and Compressing Files |
|
|
306 | (5) |
|
10.7.1 Archiving and Compressing Files with File Roller |
|
|
307 | (1) |
|
10.7.2 Archive Files and Devices: tar |
|
|
307 | (1) |
|
10.7.3 File Compression: gzip, bzip2, and zip |
|
|
308 | (3) |
|
10.8 File and Directory Attributes: is -1,1s -d |
|
|
311 | (1) |
|
10.9 File Permissions: chmod, Chown, chdir, getcwd, unlink, link, symlink |
|
|
312 | (6) |
|
|
318 | (1) |
|
|
319 | (1) |
|
|
320 | (1) |
|
|
321 | (26) |
|
|
321 | (1) |
|
|
322 | (2) |
|
11.3 Disk Partition into File System |
|
|
324 | (1) |
|
|
325 | (2) |
|
11.5 Managing File System |
|
|
327 | (1) |
|
|
327 | (1) |
|
11.6 Mounting File Systems |
|
|
328 | (7) |
|
11.6.1 Automounting Devices |
|
|
331 | (1) |
|
11.6.2 Creating File System |
|
|
332 | (1) |
|
11.6.3 Checking and Repairing File systems: fsck |
|
|
333 | (2) |
|
11.7 Errors: strerror, perror |
|
|
335 | (1) |
|
11.8 The /proc File System |
|
|
336 | (2) |
|
11.9 The Linux File System: ext, ext2, ext3, ext4, Journaling |
|
|
338 | (2) |
|
11.10 Logical Volume Management (LVM) |
|
|
340 | (1) |
|
11.11 Virtual File System (VFS) |
|
|
341 | (1) |
|
11.12 File System Conversion |
|
|
342 | (2) |
|
11.12.1 Converting ext2 to ext3 |
|
|
343 | (1) |
|
11.12.2 Converting ext2 to ext4 |
|
|
343 | (1) |
|
11.12.3 Converting ext3 to ext4 |
|
|
344 | (1) |
|
|
344 | (1) |
|
|
345 | (1) |
|
|
346 | (1) |
|
12 Linux System Programming |
|
|
347 | (32) |
|
|
347 | (4) |
|
|
347 | (2) |
|
12.1.2 Program Compilation with gcc/g++ Compiler |
|
|
349 | (1) |
|
12.1.3 Automate Program Execution with GNU Make Utility |
|
|
349 | (2) |
|
12.1.4 GNU Debugger (GDB) |
|
|
351 | (1) |
|
|
351 | (1) |
|
|
352 | (12) |
|
12.3.1 Listing Processes, PID, PPID |
|
|
352 | (3) |
|
|
355 | (1) |
|
|
356 | (1) |
|
12.3.4 Creation of New Process: fork(), vfork(), execv(), system() |
|
|
356 | (3) |
|
12.3.5 Terminating Process |
|
|
359 | (1) |
|
12.3.6 Process Priorities |
|
|
360 | (1) |
|
12.3.7 Zombie and Daemon Process |
|
|
361 | (3) |
|
|
364 | (6) |
|
|
364 | (1) |
|
12.4.2 Thread Kill or Termination |
|
|
365 | (1) |
|
12.4.3 Thread Data Structure |
|
|
366 | (1) |
|
12.4.4 Synchronization, Critical Section, and Semaphore |
|
|
366 | (3) |
|
12.4.5 Demarcation between Process and Thread |
|
|
369 | (1) |
|
|
370 | (1) |
|
|
371 | (2) |
|
12.7 Various System Calls |
|
|
373 | (1) |
|
|
374 | (1) |
|
|
375 | (1) |
|
|
376 | (2) |
|
|
378 | (1) |
|
13 Linux Inter-Process Communications |
|
|
379 | (26) |
|
|
379 | (2) |
|
|
381 | (5) |
|
13.2.1 System V Shared Memory API |
|
|
382 | (2) |
|
13.2.2 POSIX Shared Memory APIs |
|
|
384 | (2) |
|
|
386 | (6) |
|
13.3.1 System V Message Queues |
|
|
387 | (2) |
|
13.3.2 POSIX Message Queues |
|
|
389 | (3) |
|
13.4 Pipes: Named and Unnamed |
|
|
392 | (3) |
|
13.4.1 Creating pipes in C |
|
|
393 | (1) |
|
13.4.2 named pipes : FIFO |
|
|
394 | (1) |
|
|
395 | (6) |
|
|
401 | (1) |
|
|
402 | (2) |
|
|
404 | (1) |
|
14 X Window System Overview and Programming |
|
|
405 | (24) |
|
14.1 X window System and Its Customization |
|
|
405 | (3) |
|
14.1.1 X Client, X Server, and X-Protocol |
|
|
406 | (2) |
|
|
408 | (1) |
|
|
408 | (3) |
|
14.2.1 Window Manager: Motif |
|
|
410 | (1) |
|
14.3 Creating and Managing A Window |
|
|
411 | (2) |
|
14.3.1 Basic Window Concept |
|
|
411 | (1) |
|
|
412 | (1) |
|
14.4 Starting and Stopping X |
|
|
413 | (1) |
|
14.5 X Architecture and Application |
|
|
414 | (1) |
|
14.5.1 Client and Server Architecture |
|
|
414 | (1) |
|
14.6 The X Programming Model |
|
|
415 | (6) |
|
|
417 | (1) |
|
|
417 | (3) |
|
14.6.3 Event-Driven Applications |
|
|
420 | (1) |
|
|
421 | (2) |
|
|
422 | (1) |
|
|
422 | (1) |
|
14.8 Upgrading X Window Tools |
|
|
423 | (1) |
|
|
423 | (1) |
|
|
424 | (1) |
|
|
425 | (4) |
Section III Case Studies |
|
|
15 Linux Distributions (Linux Distro) |
|
|
429 | (12) |
|
15.1 Getting Started with Various Linux Distributions |
|
|
429 | (2) |
|
15.1.1 Why So Many Distros? |
|
|
430 | (1) |
|
15.2 Red Hat Enterprise Linux /Fedora |
|
|
431 | (3) |
|
|
434 | (1) |
|
|
435 | (3) |
|
15.5 Ethical aspects of using Linux: |
|
|
438 | (1) |
|
|
438 | (3) |
Index |
|
441 | |