The first part of the Linux command line
The 1th chapter of the first knowledge of Linux she
1.1 What is Linux 2
1.1.1 Deep Dive into Linux kernel 3
1.1.2 GNU Tools 6
1.1.3 Linux Desktop Environment 8
1.2 Linux Release 12
1.2.1 Core Linux Release 13
1.2.2 Linux distributions for specific purposes 13
1.2.3 Linux LiveCD 14
1.3 Summary 15
2nd Chapter into the shell
2.1 Entering command line 16
2.1.1 Console Terminal 17
2.1.2 Graphical Terminal 17
2.2 Accessing the CLI through the Linux console terminal 18
2.3 Accessing the CLI via graphical terminal emulation 20
2.4 Using the Gnome Terminal emulator 21
2.4.1 access to Gnome Terminal 21
2.4.2 Menu Bar 22
2.5 using the Konsole Terminal emulator 25
2.5.1 Access Konsole Terminal 25
2.5.2 Menu Bar 26
2.6 Using the Xterm terminal emulator 29
2.6.1 Access Xterm 30
2.6.2 command line parameter 30
2.7 Summary 32
3rd Chapter Basic Bash shell commands
3.1 Starting the Shell 33
3.2 Shell Prompt 34
3.3 Bash Handbook 34
3.4 Navigating the file system 37
3.4.1 Linux File System 37
3.4.2 Traversing the directory 40
3.5 List of files and directories 42
3.5.1 Basic List Function 42
3.5.2 Display long list 44
3.5.3 Filter Output List 45
3.6 Working with files 46
3.6.1 Creating a File 47
3.6.2 Copying Files 47
3.6.3 Tab key Auto-Complete 50
3.6.4 Link Files 50
3.6.5 Renaming a file 52
3.6.6 Deleting Files 54
3.7 Working with catalogs 55
3.7.1 Creating a directory 55
3.7.2 Deleting a directory 55
3.8 Viewing the contents of a file 58
3.8.1 Viewing file Types 58
3.8.2 viewing the entire file 59
3.8.3 Viewing some files 61
3.9 Summary 63
The 4th chapter more bash shell commands
4.1 Monitoring Procedures 64
4.1.1 Probing Process 64
4.1.2 Real-time monitoring process 70
4.1.3 End Process 72
4.2 Monitoring Disk Space 73
4.2.1 Mounting Storage Media 73
4.2.2 using the DF command 76
4.2.3 using the Du command 77
4.3 Working with data files 78
4.3.1 Sort Data 78
4.3.2 Search Data 81
4.3.3 Compressing Data 83
4.3.4 Archive Data 84
4.4 Summary 85
5th Chapter Understanding the Shell
5.1 Shell Type 86
5.2 Shell Parent-child Relationship 88
5.2.1 Process List 91
5.2.2 Ingenious Sub-shell usage 93
5.3 Understanding the Shell's built-in commands 96
5.3.1 External Command 96
5.3.2 Built-in commands 97
5.4 Summary 101
The 6th chapter uses the Linux environment variable
6.1 What is an environment variable 103
6.1.1 Global environment variable 104
6.1.2 Local Environment Variables 105
6.2 Setting user-defined variables 106
6.2.1 Setting local user-defined variables 106
6.2.2 setting Global Environment Variables 107
6.3 Deleting environment Variables 109
6.4 Default shell environment variable 110
6.5 Setting the PATH environment variable 113
6.6 Positioning System Environment Variables 114
6.6.1 Login Shell 115
6.6.2 Interactive Shell Process 119
6.6.3 Non-interactive shell 120
6.6.4 environment variable Persistence 121
6.7 Array Variables 121
6.8 Summary 122
7th. Understanding Linux File Permissions
7.1 Linux Security 124
7.1.1/ETC/PASSWD file 124
7.1.2/etc/shadow file 126
7.1.3 Adding a new user 127
7.1.4 Deleting a user 129
7.1.5 Modifying users 130
7.2 Using the Linux Group 132
7.2.1/etc/group file 133
7.2.2 Creating a new group 133
7.2.3 Modifying groups 134
7.3 Understanding File Permissions 135
7.3.1 using the file permission character 135
7.3.2 Default File Permissions 136
7.4 Changing security settings 138
7.4.1 Changing Permissions 138
7.4.2 Changing affiliation 139
7.5 Sharing Files 140
7.6 Summary 142
8th. Managing File Systems
8.1 Exploring Linux File Systems 143
8.1.1 Basic Linux File System 143
8.1.2 Log File System 145
8.1.3 copying a file system when writing 147
8.2 Operating the file system 147
8.2.1 Creating a Partition 147
8.2.2 Creating a file system 151
8.2.3 File system inspection and Repair 153
8.3 Logical Volume Management 154
8.3.1 Logical Volume Management layout 154
8.3.2 LVM in Linux 155
8.3.3 using Linux LVM 156
8.4 Summary 162
9th. Install software program
9.1 Package Management Basics 163
9.2 Debian-based systems 164
9.2.1 Management package with aptitude 164
9.2.2 Installing the package with Aptitude 166
9.2.3 Update software with aptitude 168
9.2.4 uninstalling software with aptitude 169
9.2.5 Aptitude Warehouse 169
9.3 Red Hat-based systems 171
9.3.1 List Installed packages 171
9.3.2 installing software with Yum 173
9.3.3 Update software with Yum 174
9.3.4 uninstalling software with Yum 174
9.3.5 Handling Corrupted Package Dependencies 175
9.3.6 Yum Software Warehouse 176
9.4 Installing from Source 177
9.5 Summary 180
10th chapter using the editor
10.1 Vim Editor 181
10.1.1 Checking VIM Package 181
10.1.2 Vim Basics 183
10.1.3 Editing Data 185
10.1.4 Copy and paste 185
10.1.5 Find and replace 186
10.2 Nano Editor 187
10.3 Emacs Editor 188
10.3.1 Checking Emacs Package 189
10.3.2 using Emacs 190 in the console
10.3.3 using Emacs 195 in a GUI environment
10.4 KDE System Editor 196
10.4.1 KWrite Editor 196
10.4.2 Kate Editor 200
10.5 GNOME Editor 202
10.5.1 Start Gedit 203
10.5.2 Basic Gedit Function 203
10.5.3 Setting Preferences 204
10.6 Summary 206
Part Two basics of shell scripting programming
The 11th chapter constructs the basic script
11.1 Using multiple Commands 210
11.2 Creating a shell script file 211
11.3 Displaying messages 212
11.4 Using Variables 214
11.4.1 Environment Variables 214
11.4.2 User Variables 215
11.4.3 Command Replacement 216
11.5 redirecting inputs and outputs 218
11.5.1 Output Redirection 218
11.5.2 Input REDIRECT 219
11.6 Pipe 220
11.7 Performing mathematical Operations 222
11.7.1 Expr Command 223
11.7.2 using square brackets 224
11.7.3 Floating Point Solution 225
11.8 Exit Script 228
11.8.1 View exit status Code 228
11.8.2 Exit Command 229
11.9 Summary 231
12th. Use of STRUCTURED commands
12.1 using the If-then statement 232
12.2 If-then-else Statement 235
12.3 Nesting if 235
12.4 Test Command 238
12.4.1 Numerical comparison 240
12.4.2 string Comparison 242
12.4.3 File Comparison 246
12.5 Compound condition Test 254
Advanced features of 12.6 If-then 255
12.6.1 using double brackets 255
12.6.2 using both brackets 256
12.7 Case Command 257
12.8 Summary 258
13th chapter More Structured commands
13.1 for Command 260
13.1.1 reading a value from a list 261
13.1.2 reading a complex value from a list 262
13.1.3 reading a list from a variable 263
13.1.4 reading a value from a command 264
13.1.5 Changing the field separator 265
13.1.6 reading a directory with wildcards 266
13.2 C Language style for command 268
13.2.1 C Language for command 268
13.2.2 Using multiple Variables 269
13.3 while command 270
Basic format for 13.3.1 while 270
13.3.2 using multiple test commands 271
13.4 until command 272
13.5 Nested Loops 274
13.6 Loop processing File Data 276
13.7 Control Cycle 277
13.7.1 Break Command 277
13.7.2 Continue command 280
13.8 processing the output of the loop 282
13.9 Example 283
13.9.1 finding an executable file 284
13.9.2 Creating multiple user accounts 285
13.10 Summary 286
The 14th chapter deals with user input
14.1 command-line Parameters 287
14.1.1 Reading Parameters 287
14.1.2 Read script name 289
14.1.3 Test Parameters 291
14.2 Special parameter Variables 292
14.2.1 parameter Statistics 292
14.2.2 fetching all the data 294
14.3 Moving a variable 295
14.4 Processing Options 296
14.4.1 Find Options 297
14.4.2 using the getopt command 300
14.4.3 using the more advanced getopts 302
14.5 Standardizing Options 305
14.6 Getting user Input 306
14.6.1 Basic Reading 306
14.6.2 Timeout 307
14.6.3 Hidden mode Read 308
14.6.4 reading from a file 309
14.7 Summary 309
The 15th chapter presents the data
15.1 understanding inputs and outputs 311
15.1.1 Standard File Descriptor 311
15.1.2 REDIRECT Error 313
15.2 redirect output in script 315
15.2.1 Temporary REDIRECT 315
15.2.2 Permanent REDIRECT 316
15.3 redirect Input in script 317
15.4 Creating your own redirect 317
15.4.1 creating the output file descriptor 318
15.4.2 Redirect File descriptor 318
15.4.3 Creating an input file descriptor 319
15.4.4 creating read-write file descriptors 320
15.4.5 Closing file descriptors 321
15.5 Listing Open File descriptors 322
15.6 Block Command Output 323
15.7 Creating a temporary file 324
15.7.1 creating a local temporary file 324
15.7.2 creating temporary files in the/tmp directory 325
15.7.3 Creating a temp directory 326
15.8 Logging Messages 327
15.9 Example 328
15.10 Summary 330
16th Chapter Control Script
16.1 Processing Signal 331
16.1.1 Replay Linux Signals 331
16.1.2 Generating Signal 332
16.1.3 Capture Signal 334
16.1.4 Capture Script Exit 335
16.1.5 modifying or removing a capture 335
16.2 running scripts in the next mode 338
16.2.1 running scripts in the background 338
16.2.2 running multiple background jobs 340
16.3 Run script under non-console 341
16.4 Job Control 342
16.4.1 Viewing Jobs 342
16.4.2 restarting a stopped job 344
16.5 adjust the degree of humility 345
16.5.1 Nice command 345
16.5.2 renice Command 346
16.6 running the job at timed 346
16.6.1 using the AT command to schedule the execution of a job 347
16.6.2 schedule scripts that need to be executed on a regular basis 349
16.6.3 using the new shell startup script 352
16.7 Summary 353
Part III Advanced Shell scripting programming
17th. Creating a function
17.1 Basic Scripting Functions 356
17.1.1 Creating a function 357
17.1.2 using Functions 357
17.2 return Value 359
17.2.1 Default exit Status code 359
17.2.3 using function Output 361
17.3 using a variable in a function 362
17.3.1 passing a parameter 362 to a function
17.3.2 working with variables in a function 364
17.4 array variables and functions 366
17.4.1 to function array parameter 366
17.4.2 returning an array from a function 368
17.5 function Recursion 369
17.6 Creating a library 370
17.7 using functions on the command line 371
17.7.1 Creating a function on the command line 372
17.7.2 defining functions in. bashrc Files 372
17.8 example 374
17.8.1 Download and install 374
17.8.2 Building a library 374
17.8.3 Shtool Library Function 376
17.8.4 using the Library 376
17.9 Summary 377
18th script Programming in graphical desktop environments
18.1 Creating a Text menu 378
18.1.1 Creating a menu layout 379
18.1.2 Creating a Menu function 380
18.1.3 Adding a menu logic 380
18.1.4 Integrated shell Script Menu 381
18.1.5 using the Select command 382
18.2 Making Windows 384
18.2.1 Dialog Pack 384
18.2.2 dialog Option 389
18.2.3 using the dialog command in a script 391
18.3 using graphics 393
18.3.1 KDE Environment 393
18.3.2 GNOME Environment 396
18.4 Summary 400
The 19th chapter is the first to know SED and gawk
19.1 Text Processing 401
19.1.1 SED Editor 401
19.1.2 gawk program 404
19.2 SED Editor Basics 410
19.2.1 more options for replacement 410
19.2.2 using Address 411
19.2.3 Deleting Rows 414
19.2.4 inserting and attaching text 415
19.2.5 Modifying line 417
19.2.6 Conversion Command 418
19.2.7 Review Print 419
19.2.8 using SED to process files 421
19.3 Summary 423
20th-Regular Expressions
20.1 What is a regular expression 424
20.1.1 definition 424
20.1.2 type of regular expression 425
20.2 Defining BRE Mode 426
20.2.1 Plain Text 426
20.2.2 Special Characters 427
20.2.3 Anchor Character 428
20.2.4 Dot character 430
20.2.5 Character Set 430
20.2.6 exclusion type Character Set 432
20.2.7 Zone 433
20.2.8 Special Group of characters 434
20.2.9 Asterisk 434
20.3 Extending regular Expressions 436
20.3.1 question mark 436
20.3.2 Plus 437
20.3.3 using curly braces 437
20.3.4 Pipe Symbol 438
20.3.5 Expression Grouping 439
20.4 Regular expression real-combat 439
20.4.1 Directory File Count 440
20.4.2 Verify phone number 441
20.4.3 parsing e-mail address 443
20.5 Summary 444
21st Chapter SED Advanced
21.1 Multi-line command 445
21.1.1 Next Command 446
21.1.2 Multi-line Delete command 449
21.1.3 Multi-line Print command 449
21.2 Holding space 450
21.3 Exclude Commands 451
21.4 Change Flow 454
21.4.1 Branch 454
21.4.2 Test 455
21.5 mode Override 456
21.5.1 & Symbols 457
21.5.2 replacing individual words 457
21.6 using sed 458 in scripts
21.6.1 using wrapper scripts 458
21.6.2 redirecting the output of SED 459
21.7 creating the SED utility 460
21.7.1 Doubling line spacing 460
21.7.2 double line spacing for files that may contain blank lines 460
21.7.3 number of lines in a file 461
21.7.4 Print End Line 462
21.7.5 Deleting Rows 463
21.7.6 Deleting HTML tags 466
21.8 Summary 467
22nd Chapter Gawk Advanced
22.1 Using Variables 469
22.1.1 built-in variables 469
22.1.2 Custom Variables 474
22.2 Working with arrays 476
22.2.1 defining an array variable 476
22.2.2 times the enumeration group variable 477
22.2.3 Deleting an array variable 478
22.3 Usage Mode 478
22.3.1 Regular Expression 478
22.3.2 matching operator 479
22.3.3 Mathematical Expressions 480
22.4 Structured Commands 480
22.4.1 If statement 480
22.4.2 While statement 482
22.4.3 Do-while Statement 483
22.4.4 for statement 484
22.5 format Printing 484
22.6 built-in functions 487
22.6.1 Mathematical Function 487
22.6.2 String Function 488
22.6.3 Time Function 490
22.7 Custom Functions 490
22.7.1 Defining a function 490
22.7.2 using Custom Functions 491
22.7.3 Creating a function library 491
22.8 Example 492
22.9 Summary 493
Chapter 23rd using other shells
23.1 What is dash Shell 495
23.2 Dash Shell features 496
23.2.1 Dash command line parameter 496
23.2.2 Dash environment variable 497
23.2.3 Dash built-in command 499
23.3 Dash Script Programming 500
23.3.1 creating a Dash script 500
23.3.2 features that cannot be used 500
23.4 zsh Shell 502
23.5 zsh Shell Composition 503
23.5.1 Shell Option 503
23.5.2 built-in commands 504
23.6 zsh Script Programming 508
23.6.1 Mathematical Operations 508
23.6.2 Structured Commands 509
23.6.3 function 510
23.7 Summary 510
Part IV Creating a useful script
24th. Writing a simple script utility
24.1 Archive 514
24.2 Managing user Accounts 523
Features required by 24.2.1 523
24.2.2 Creating a script 530
24.2.3 Running script 535
24.3 Monitoring disk space 537
Features required by 24.3.1 537
24.3.2 Creating a script 540
24.3.3 Running script 541
24.4 Summary 542
25th. Create scripts related to database, Web, and e-mail
25.1 MySQL Database 543
25.1.1 using MySQL 543
25.1.2 using databases in scripts 552
25.2 using Web 555
25.2.1 Installing Lynx 556
25.2.2 Lynx Command Line 557
25.2.3 Lynx configuration file 558
25.2.4 getting data from Lynx 559
25.3 using e-mail 561
25.4 Summary 564
The 26th chapter some small interesting script
26.1 Sending a message 565
26.1.1 Function Analysis 565
26.1.2 Creating a script 568
26.2 get the motto 573
26.2.1 Function Analysis 574
26.2.2 Creating a script 577
26.3 fabricated excuses 583
26.3.1 function Analysis 583
26.3.2 Creating a Script 586
26.4 Summary 587
Appendix A Bash Command quick guide 589
Appendix B sed and gawk quick Guide 597
Linux command line and Shell Script Programming Encyclopedia 3rd edition