About the Author |
|
xvii | |
About the Technical Reviewer |
|
xix | |
Preface |
|
xxi | |
Part 1: Preparing for Part I |
|
1 | (86) |
|
Chapter 1 Editing Text with Vim and Joe |
|
|
5 | (30) |
|
1.1 A Brief History of Unix Text Editors |
|
|
5 | (1) |
|
|
6 | (5) |
|
|
6 | (1) |
|
1.2.2 Regular Expressions: What You Need To Know Right Now |
|
|
7 | (4) |
|
1.2.3 Remaining Terms of Endearment |
|
|
11 | (1) |
|
|
11 | (18) |
|
1.3.1 Moving Around in the Buffer |
|
|
16 | (1) |
|
1.3.2 Registers and Clipboard Integration |
|
|
17 | (1) |
|
|
18 | (1) |
|
|
18 | (1) |
|
1.3.5 Visual Selection Modes |
|
|
19 | (2) |
|
1.3.6 Recording and Playing Macros |
|
|
21 | (3) |
|
|
24 | (1) |
|
|
25 | (2) |
|
1.3.9 Vim Abbreviations and Auto-Completion Framework |
|
|
27 | (1) |
|
|
28 | (1) |
|
1.4 Joe's Own Editor (Joe) |
|
|
29 | (4) |
|
|
32 | (1) |
|
|
33 | (2) |
|
Chapter 2 Essential Unix Commands and Terminology |
|
|
35 | (30) |
|
2.1 Kernel, Shell, and Filesystem |
|
|
35 | (1) |
|
2.2 Files and Special Files |
|
|
36 | (4) |
|
|
37 | (1) |
|
|
37 | (1) |
|
|
38 | (1) |
|
|
39 | (1) |
|
|
40 | (1) |
|
|
40 | (1) |
|
2.3 Essential Unix Commands |
|
|
40 | (24) |
|
|
40 | (1) |
|
|
41 | (1) |
|
|
41 | (1) |
|
|
41 | (1) |
|
|
41 | (1) |
|
2.3.6 cp <source> <destination> |
|
|
42 | (1) |
|
2.3.7 mv <source> <destination> |
|
|
42 | (1) |
|
|
42 | (1) |
|
2.3.9 In [ -s] <path> <additional> |
|
|
42 | (1) |
|
|
43 | (1) |
|
|
43 | (1) |
|
|
44 | (1) |
|
|
45 | (1) |
|
2.3.14 grep <regex> [ <file>] |
|
|
46 | (1) |
|
|
47 | (1) |
|
|
48 | (1) |
|
|
49 | (1) |
|
|
49 | (1) |
|
|
49 | (1) |
|
|
49 | (1) |
|
|
50 | (1) |
|
|
50 | (1) |
|
|
50 | (1) |
|
|
51 | (1) |
|
|
51 | (1) |
|
|
51 | (1) |
|
|
52 | (1) |
|
|
52 | (1) |
|
|
52 | (1) |
|
|
53 | (1) |
|
|
54 | (1) |
|
|
54 | (1) |
|
|
54 | (1) |
|
|
55 | (1) |
|
|
55 | (1) |
|
|
56 | (1) |
|
|
56 | (1) |
|
2.3.38 cmp <file1> <file2> |
|
|
56 | (1) |
|
2.3.39 diff <file1> <file2> |
|
|
56 | (1) |
|
|
57 | (1) |
|
2.3.41 kill [ <sig>] <pid> |
|
|
57 | (1) |
|
|
58 | (1) |
|
|
58 | (1) |
|
|
58 | (1) |
|
2.3.45 chmod <mode> <file> |
|
|
59 | (1) |
|
2.3.46 chown <user> <file> |
|
|
60 | (1) |
|
|
61 | (1) |
|
|
61 | (1) |
|
|
61 | (1) |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
63 | (1) |
|
|
63 | (1) |
|
|
63 | (1) |
|
|
64 | (1) |
|
2.3.56 sha256[ sum] <file> |
|
|
64 | (1) |
|
|
64 | (1) |
|
Chapter 3 Bourne Shell Scripting |
|
|
65 | (22) |
|
3.1 Inside Our First Shell Script |
|
|
65 | (1) |
|
|
66 | (3) |
|
3.3 Arithmetic and Boolean Operations |
|
|
69 | (1) |
|
3.4 Command Chaining and Grouping |
|
|
70 | (1) |
|
3.5 Meta-Character Expansion |
|
|
71 | (1) |
|
3.6 Quoting: Single, Double, and Back |
|
|
72 | (1) |
|
3.7 Setting the Shell Prompt |
|
|
73 | (1) |
|
3.8 Dealing with Whitespace in Filenames |
|
|
74 | (2) |
|
|
76 | (1) |
|
|
77 | (2) |
|
3.11 Branching and Looping |
|
|
79 | (3) |
|
|
82 | (1) |
|
3.13 Sourcing, Aliasing, and Exporting |
|
|
83 | (2) |
|
3.14 Putting It All Together |
|
|
85 | (1) |
|
|
85 | (2) |
Part 2: Preparing for Part II |
|
87 | (194) |
|
Chapter 4 PC Hardware for Unix |
|
|
89 | (20) |
|
|
89 | (1) |
|
|
90 | (1) |
|
4.3 CPU (Central Processing Unit) |
|
|
91 | (1) |
|
4.4 System Board/Motherboard |
|
|
92 | (3) |
|
4.5 RAM (Random Access Memory) |
|
|
95 | (1) |
|
|
96 | (1) |
|
4.7 SMPS (Switched Mode Power Supply) |
|
|
97 | (1) |
|
|
98 | (1) |
|
|
99 | (3) |
|
4.10 Optical Drive (CD/DVD Reader and Writer) |
|
|
102 | (1) |
|
|
103 | (2) |
|
|
105 | (2) |
|
4.12.1 Buying an HP Printer |
|
|
105 | (1) |
|
4.12.2 Buying an Epson Printer |
|
|
106 | (1) |
|
|
107 | (2) |
|
Chapter 5 Installing and Configuring FreeBSD/Linux |
|
|
109 | (30) |
|
|
109 | (3) |
|
5.1.1 MBR (Master Boot Record) |
|
|
110 | (1) |
|
5.1.2 GPT (GUID Partition Table) |
|
|
111 | (1) |
|
5.2 Do We Have Enough Disk Space? |
|
|
112 | (1) |
|
5.3 The Default Partitioning Scheme |
|
|
113 | (1) |
|
5.4 Preparing the Computer's CMOS for Unix |
|
|
114 | (2) |
|
5.5 Downloading and Burning Installation Media |
|
|
116 | (1) |
|
5.6 Our Example Hard Disk |
|
|
117 | (1) |
|
|
118 | (7) |
|
5.8 Installing and Configuring Linux |
|
|
125 | (5) |
|
5.9 Post-Install Configuration of FreeBSD |
|
|
130 | (6) |
|
|
131 | (1) |
|
5.9.2 Software Packaging Subsystem |
|
|
131 | (1) |
|
|
131 | (1) |
|
|
132 | (1) |
|
5.9.5 NVIDIA Graphics Driver Addition |
|
|
133 | (1) |
|
5.9.6 NVIDIA and ATI Radeon Graphics Configuration |
|
|
133 | (1) |
|
|
134 | (1) |
|
5.9.8 Graphical Desktop Environment |
|
|
135 | (1) |
|
5.9.9 Making Things Easier: A Simpler Way to Configure FreeBSD |
|
|
135 | (1) |
|
5.10 Dual-Booting FreeBSD and Linux on a GPT Disk |
|
|
136 | (2) |
|
|
138 | (1) |
|
Chapter 6 Basic System Administration |
|
|
139 | (34) |
|
|
139 | (1) |
|
|
140 | (4) |
|
|
144 | (2) |
|
6.4 Console Configuration |
|
|
146 | (1) |
|
6.5 Internet Connectivity |
|
|
146 | (4) |
|
|
150 | (1) |
|
|
151 | (2) |
|
6.8 Running X Applications as Root |
|
|
153 | (1) |
|
6.9 Finding Local Files Quickly |
|
|
154 | (1) |
|
6.10 Configuring the Printer |
|
|
155 | (2) |
|
|
157 | (1) |
|
6.12 Using an APC Powerchute UPS to Shut the System Down |
|
|
158 | (1) |
|
6.13 Building Stuff from Sources |
|
|
159 | (1) |
|
6.14 Unix Virtual Filesystems |
|
|
160 | (2) |
|
6.15 Additional Commands to Administer Your Desktop |
|
|
162 | (6) |
|
|
162 | (1) |
|
|
162 | (1) |
|
|
163 | (1) |
|
|
164 | (1) |
|
6.15.5 Loop Device Configuration |
|
|
165 | (1) |
|
|
165 | (1) |
|
|
166 | (2) |
|
6.16 Mitigating the Need for Backups |
|
|
168 | (4) |
|
|
172 | (1) |
|
Chapter 7 The Best of the Graphical Unix |
|
|
173 | (40) |
|
7.1 X Is a Client-Server System |
|
|
173 | (2) |
|
|
175 | (2) |
|
|
177 | (3) |
|
7.4 Starting X and the Desktop Environment |
|
|
180 | (1) |
|
7.5 Applications in the Desktop Environment |
|
|
181 | (30) |
|
|
181 | (1) |
|
|
182 | (2) |
|
|
184 | (3) |
|
7.5.4 Accessing and Downloading Remote Data |
|
|
187 | (4) |
|
7.5.5 Playing Multimedia Content |
|
|
191 | (5) |
|
|
196 | (3) |
|
7.5.7 LibreOffice: The New and Better Office |
|
|
199 | (1) |
|
|
200 | (1) |
|
|
201 | (1) |
|
7.5.10 CD/DVD Writing Frontends |
|
|
202 | (1) |
|
7.5.11 Internet Messaging and Chat Clients |
|
|
203 | (2) |
|
7.5.12 Multimedia Editing Software |
|
|
205 | (1) |
|
7.5.13 Fun Stuff: Games and Blogging |
|
|
206 | (3) |
|
7.5.14 The Question of a Graphical Integrated Development Environment |
|
|
209 | (2) |
|
|
211 | (2) |
|
Chapter 8 Emulation Layers: Wine and Linuxulator |
|
|
213 | (32) |
|
8.1 Wine HQ: Attacking Redmond |
|
|
213 | (2) |
|
|
215 | (1) |
|
8.3 The Filesystem Hierarchy of Wine |
|
|
216 | (1) |
|
8.4 Running Windows Applications Under Wine |
|
|
217 | (1) |
|
8.5 Running Pinta as a Windows Application |
|
|
218 | (1) |
|
8.6 Maintaining Your Wine Environment |
|
|
219 | (3) |
|
|
222 | (1) |
|
8.8 Version Mimicking Under Wine |
|
|
222 | (2) |
|
8.9 Wine Libraries (DLLs) |
|
|
224 | (2) |
|
8.10 Tweaking Wine Still Further |
|
|
226 | (1) |
|
8.11 Wine Uses a Client-Server Model Too |
|
|
226 | (2) |
|
8.12 Graphical Tools for Wine Administration |
|
|
228 | (3) |
|
8.13 Developing Applications for Wine |
|
|
231 | (1) |
|
|
232 | (2) |
|
8.15 Yet Another Imitation Game: Linuxulator |
|
|
234 | (10) |
|
8.15.1 Using c6 Linuxulator |
|
|
236 | (3) |
|
8.15.2 Using c7 Linuxulator |
|
|
239 | (4) |
|
8.15.3 Installing Linux ABI Applications via rpm |
|
|
243 | (1) |
|
|
244 | (1) |
|
Chapter 9 Virtualization: The New Buzzword |
|
|
245 | (36) |
|
9.1 What Is Virtualization (And Why Is It Important)? |
|
|
245 | (2) |
|
9.2 Storage for Virtual Machines |
|
|
247 | (1) |
|
9.3 Running an Anonymous FTP Server Under FreeBSD/Linux |
|
|
247 | (3) |
|
|
250 | (16) |
|
9.4.1 Installing VirtualBox |
|
|
250 | (3) |
|
9.4.2 Hosting Your First VirtualBox Virtual Machine |
|
|
253 | (8) |
|
9.4.3 Exchanging Files with the VirtualBox Host |
|
|
261 | (1) |
|
9.4.4 VirtualBox Extensions |
|
|
261 | (5) |
|
|
266 | (4) |
|
|
270 | (9) |
|
|
279 | (2) |
Part 3: Preparing for Part III |
|
281 | (120) |
|
Chapter 10 Advanced Techniques in Shell Scripting |
|
|
283 | (30) |
|
|
283 | (3) |
|
10.2 Variable Type Modifiers: Readonly/Local |
|
|
286 | (2) |
|
|
288 | (2) |
|
|
290 | (1) |
|
|
290 | (2) |
|
|
292 | (1) |
|
10.7 Special Shell Variables: LINENO and IFS |
|
|
293 | (1) |
|
|
294 | (2) |
|
|
296 | (2) |
|
10.10 Scripting with ncurses |
|
|
298 | (12) |
|
|
299 | (1) |
|
|
299 | (1) |
|
|
300 | (1) |
|
|
301 | (1) |
|
|
301 | (1) |
|
|
302 | (1) |
|
|
303 | (1) |
|
|
303 | (1) |
|
|
304 | (1) |
|
|
305 | (2) |
|
|
307 | (1) |
|
|
307 | (1) |
|
10.10.13 File Selection Box |
|
|
308 | (1) |
|
10.10.14 And There Are Many More |
|
|
309 | (1) |
|
|
310 | (1) |
|
|
311 | (2) |
|
Chapter 11 Unix Programming with C and Vala |
|
|
313 | (88) |
|
11.1 Systems Programming with C |
|
|
315 | (58) |
|
11.1.1 The C Compilation Process |
|
|
317 | (1) |
|
|
318 | (1) |
|
|
319 | (1) |
|
|
320 | (3) |
|
|
323 | (1) |
|
|
323 | (4) |
|
|
327 | (2) |
|
11.1.8 Differentiating Between Stack and Heap |
|
|
329 | (2) |
|
|
331 | (4) |
|
11.1.10 Signature of main() |
|
|
335 | (1) |
|
11.1.11 Branching and Looping |
|
|
336 | (1) |
|
11.1.12 Arithmetic and Logical Operations |
|
|
337 | (1) |
|
|
338 | (2) |
|
11.1.14 Declarations and Definitions |
|
|
340 | (1) |
|
|
341 | (4) |
|
|
345 | (1) |
|
11.1.17 Variable Argument Lists |
|
|
346 | (2) |
|
|
348 | (1) |
|
11.1.19 Using System Calls for I/O |
|
|
349 | (6) |
|
11.1.20 Multithreading with pthreads |
|
|
355 | (4) |
|
11.1.21 Socket Programming |
|
|
359 | (14) |
|
11.1.22 Addressing the Makefile |
|
|
373 | (1) |
|
11.2 Graphical Application Development with Vala |
|
|
373 | (26) |
|
11.2.1 The Bare Essentials of 00P |
|
|
374 | (7) |
|
11.2.2 Charter of 00 Terminology |
|
|
381 | (1) |
|
11.2.3 Benefits and Drawbacks of 00 Programming |
|
|
382 | (1) |
|
|
383 | (4) |
|
11.2.5 Vala Documentation |
|
|
387 | (1) |
|
11.2.6 The BMI Tool Written in Vala |
|
|
387 | (8) |
|
11.2.7 Vala Is Not Just GUI Development! |
|
|
395 | (4) |
|
|
399 | (2) |
Appendix: The Last Frontier |
|
401 | (12) |
|
A.1 Solution to the Difficult Step in Chapter 1 |
|
|
401 | (1) |
|
A.2 Sources for the Shell Script tcase from Chapter 3 |
|
|
402 | (1) |
|
A.3 Sources for the Shell Script extract.sh from Chapter 3 |
|
|
403 | (1) |
|
A.4 Setting Up a Swap Partition Shared by FreeBSD and Linux from Chapter 5 |
|
|
404 | (2) |
|
A.5 Sources for halt.c from Chapter 8 |
|
|
406 | (5) |
|
A.6 GNUmakefile for Creating an Executable from Chapter 11 |
|
|
411 | (2) |
Index |
|
413 | |