文件名称:
Teach Yourself Unix in 24 Hours 1st ed Dave Taylor James C. Armstrong Jr. 1997
开发工具:
文件大小: 4mb
下载次数: 0
上传时间: 2010-09-30
详细说明: Overview Hour 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Introduction xvi What Is this UNIX Stuff? 1 Getting onto the System and Using the Command Line 21 Moving About the File System 43 Listing Files and Managing Disk Usage 63 Ownership and Permissions 87 Creating, Moving, Renaming, and Deleting Files and Directories 113 Looking into Files 127 Filters and Piping 145 Wildcards and Regular Expressions 161 Power Filters and File Redirection 187 An Introduction to the vi Editor 199 Advanced vi Tricks, Tools, and Techniques 245 An Overview of the emacs Editor 281 Introduction to Command Shells 305 Getting the Most Out of the C Shell 323 Basic Shell Programming 347 Job Control 361 Printing in the UNIX Environment 379 Searching for Information and Files 397 Communicating with Others 407 Using Netscape To See the World Wide Web 425 Internet E-Mail, Netnews, and IRC 443 Using telnet and ftp 479 Programming in C for UNIX 509 Glossary 531 Index 541 Teach Yourself UNIX in 24 Hours vi Contents Hour 1 What Is This UNIX Stuff? 1 Goals for This Hour ................................................................................... 1 What Is UNIX? .......................................................................................... 2 A Brief History of UNIX ............................................................................ 3 The C Programming Language .............................................................. 4 UNIX Becomes Popular ........................................................................ 5 What’s All This About Multiuser Systems? ................................................. 5 Cracking Open the Shell ............................................................................ 6 Getting Help .............................................................................................. 7 Task 1.1: Man Pages, UNIX Online Reference ...................................... 7 Task 1.2: Other Ways to Find Help in UNIX ..................................... 14 Summary .................................................................................................. 17 Workshop ................................................................................................ 17 Key Terms ........................................................................................... 17 Questions ............................................................................................ 18 Preview of the Next Hour .................................................................... 19 2 Getting onto the System and Using the Command Line 21 Goals for This Hour ................................................................................. 21 Task 2.1: Logging In and Out of the System ....................................... 22 Task 2.2: Changing Passwords with passwd ........................................ 25 Task 2.3: Picking a Secure Password .................................................... 26 Task 2.4: Who Are You? ...................................................................... 28 Task 2.5: Finding Out What Other Users Are Logged in to the System ................................................................................. 30 Task 2.6: What Is Everyone Doing on the Computer? ......................... 31 Task 2.7: Checking the Current Date and Time .................................. 33 Task 2.8: Looking at a Calendar .......................................................... 33 Simple Math with UNIX .......................................................................... 36 Task 2.9: Using the bc Infix Calculator ............................................... 36 Task 2.10: Using the dc Postfix Calculator .......................................... 38 Summary .................................................................................................. 40 Workshop ................................................................................................ 40 Key Terms ........................................................................................... 40 Questions ............................................................................................ 41 Preview of the Next Hour .................................................................... 41 3 Moving About the File System 43 Goals for This Hour ................................................................................. 43 What a Hierarchical File System Is All About ........................................... 44 Task 3.1: The UNIX File System Organization ................................... 45 The bin Directory ............................................................................... 46 The dev Directory ............................................................................... 47 The etc Directory ............................................................................... 47 The lib Directory ............................................................................... 47 The lost+found Directory .................................................................. 48 The mnt and sys Directories ............................................................... 48 The tmp Directory ............................................................................... 48 The usr Directory ............................................................................... 48 Other Miscellaneous Stuff at the Top Level ......................................... 49 How Mac and PC File Systems Differ from the UNIX File System .......... 50 Directory Separator Characters ................................................................. 50 The Difference Between Relative and Absolute Filenames ........................ 51 Task 3.2: Hidden Files in UNIX ......................................................... 52 Task 3.3: The Special Directories “.” and “..” ...................................... 55 Task 3.4: The env Command .............................................................. 56 Task 3.5: PATH and HOME ..................................................................... 57 Task 3.6: Find Where You Are with pwd ............................................. 58 Task 3.7: Move to Another Location with cd ...................................... 58 Summary .................................................................................................. 60 Workshop ................................................................................................ 60 Key Terms ........................................................................................... 60 Questions ............................................................................................ 62 Preview of the Next Hour .................................................................... 62 4 Listing Files and Managing Disk Usage 63 Goals for This Hour ................................................................................. 63 The ls Command ............................................................................... 64 Task 4.1: All About the ls Command ................................................. 64 Task 4.2: Having ls Tell You More .................................................... 65 Task 4.3: Combining Flags .................................................................. 68 Task 4.4: Listing Directories Without Changing Location ................... 69 Special ls Command Flags ....................................................................... 71 Task 4.5: Changing the Sort Order in ls ............................................. 71 Task 4.6: Listing Directory Trees Recursively in ls ............................. 73 Task 4.7: Long Listing Format in ls ................................................... 74 Permissions Strings .............................................................................. 74 Task 4.8: Long Listing Format for Directories in ls ............................ 75 Task 4.9: Creating Files with the touch Command ............................. 78 Task 4.10: Check Disk-Space Usage with du ....................................... 79 Task 4.11: Check Available Disk Space with df ................................... 82 Task 4.12: Shrink Big Files with the compress Program ..................... 83 Summary .................................................................................................. 84 Workshop ................................................................................................ 84 Key Terms ........................................................................................... 84 Questions ............................................................................................ 85 Preview of the Next Hour .................................................................... 85 Teach Yourself UNIX in 24 Hours viii 5 Ownership and Permissions 87 Goals for This Hour ................................................................................. 87 Task 5.1: Understand File Permissions Settings ................................... 88 Task 5.2: Directory Permissions Settings ............................................. 93 Task 5.3: Modify File and Directory Permissions with chmod .............. 96 Task 5.4: Set New File Permissions with chmod ................................... 98 Task 5.5: Calculating Numeric Permissions Strings ........................... 102 Task 5.6: Establish Default File and Directory Permissions with the umask Command .............................................................. 104 Task 5.7: Identify Owner and Group for Any File or Directory ......... 107 Task 5.8: Change the Owner of a File or Directory ........................... 108 Task 5.9: Change the Group of a File or Directory ............................ 109 Summary ................................................................................................ 110 Workshop .............................................................................................. 110 Key Terms ......................................................................................... 110 Questions .......................................................................................... 111 Preview of the Next Hour .................................................................. 111 6 7 Creating, Moving, Renaming, and Deleting Files and Directories 113 Goals for This Hour ............................................................................... 113 Task 6.1: Creating New Directories Using mkdir .............................. 114 Task 6.2: Copying Files to New Locations Using cp .......................... 116 Task 6.3: Moving Files to New Locations Using mv ........................... 118 Task 6.4: Renaming Files with mv ...................................................... 119 Task 6.5: Removing Directories with rmdir ...................................... 120 Task 6.6: Removing Files Using rm .................................................... 121 Task 6.7: Minimizing the Danger of the rm Command ..................... 123 Summary ................................................................................................ 125 Workshop .............................................................................................. 125 Key Terms ......................................................................................... 125 Questions .......................................................................................... 126 Preview of the Next Hour .................................................................. 126 Looking into Files 127 Goals for This Hour ............................................................................... 127 Task 7.1: Using file to Identify File Types ...................................... 128 Task 7.2: Exploring UNIX Directories with file .............................. 130 Task 7.3: Peeking at the First Few Lines with head ........................... 133 Task 7.4: Viewing the Last Few Lines with tail ............................... 135 Task 7.5: Viewing the Contents of Files with cat .............................. 136 Task 7.6: Viewing Larger Files with more .......................................... 139 Summary ................................................................................................ 143 Workshop .............................................................................................. 143 Key Terms ......................................................................................... 143 Questions .......................................................................................... 144 Preview of the Next Hour .................................................................. 144 Contents 8 Filters and Piping ix 145 Goals for This Hour ............................................................................... 145 Task 8.1: The Secrets of File Redirection ........................................... 146 Task 8.2: Counting Words and Lines Using wc ................................. 147 Task 8.3: Removing Extraneous Lines Using uniq ............................ 149 Task 8.4: Sorting Information in a File Using sort ........................... 150 Task 8.5: Number Lines in Files Using cat -n and nl ....................... 153 Task 8.6: Cool nl Tricks and Capabilities ......................................... 154 Summary ................................................................................................ 157 Workshop .............................................................................................. 158 Key Terms ......................................................................................... 158 Questions .......................................................................................... 158 Preview of the Next Hour .................................................................. 159 9 10 11 Wildcards and Regular Expressions 161 Goals for This Hour ............................................................................... 161 Task 9.1: Filename Wildcards ............................................................ 162 Task 9.2: Advanced Filename Wildcards ........................................... 164 Task 9.3: Creating Sophisticated Regular Expressions ........................ 167 Task 9.4: Searching Files Using grep ................................................. 172 Task 9.5: For Complex Expressions, Try egrep ................................. 175 Task 9.6: Searching for Multiple Patterns at Once with fgrep .......... 176 Task 9.7: Changing Things En Route with sed ................................. 179 Summary ................................................................................................ 185 Workshop .............................................................................................. 185 Key Terms ......................................................................................... 185 Questions .......................................................................................... 185 Preview of the Next Hour .................................................................. 186 Power Filters and File Redirection 187 Goals for This Hour ............................................................................... 187 Task 10.1: The Wild and Weird awk Command ............................... 188 Task 10.2: Re-routing the Pipeline with tee ...................................... 196 Summary ................................................................................................ 197 Workshop .............................................................................................. 197 Questions .......................................................................................... 197 Preview of the Next Hour .................................................................. 198 An Introduction to the vi Editor 199 Goals for This Hour ............................................................................... 200 Task 11.1: How To Start and Quit vi ............................................... 200 Task 11.2: Simple Cursor Motion in vi ............................................ 205 Task 11.3: Moving by Words and Pages ............................................ 208 Task 11.4: Inserting Text into the File Using i, a, o, and O ............... 212 Task 11.5: Deleting Text ................................................................... 220 Task 11.6: Searching Within a File .................................................... 229 Task 11.7: How To Start vi Correctly .............................................. 234 Task 11.8: The Colon Commands in vi ........................................... 236 Teach Yourself UNIX in 24 Hours x Summary ................................................................................................ 242 Workshop .............................................................................................. 243 Key Terms ......................................................................................... 243 Questions .......................................................................................... 244 Preview of the Next Hour .................................................................. 244 12 13 14 Advanced vi Tricks, Tools, and Techniques 245 Goals for This Hour ............................................................................... 245 Task 12.1: The Change and Replace Commands ............................... 246 Task 12.2: Numeric Repeat Prefixes .................................................. 253 Task 12.3: Numbering Lines in the File ............................................ 255 Task 12.4: Search and Replace ........................................................... 257 Task 12.5: Mapping Keys with the :map Command .......................... 260 Task 12.6: Moving Sentences and Paragraphs .................................... 266 Task 12.7: Access UNIX with ! ......................................................... 270 Summary of vi Commands .................................................................... 278 Summary ................................................................................................ 279 Workshop .............................................................................................. 279 Key Terms ......................................................................................... 279 Questions .......................................................................................... 279 Preview of the Next Hour .................................................................. 280 An Overview of the emacs Editor 281 Goals for This Hour ............................................................................... 281 Task 13.1: Launching emacs and Inserting Text ................................ 282 Task 13.2: How To Move Around in a File ....................................... 285 Task 13.3: How To Delete Characters and Words ............................ 289 Task 13.4: Search and Replace in emacs ............................................ 294 Task 13.5: Using the emacs Tutorial and Help System ...................... 297 Task 13.6: Working with Other Files ................................................ 299 Summary ................................................................................................ 303 Workshop .............................................................................................. 303 Key Terms ......................................................................................... 303 Questions .......................................................................................... 303 Preview of the Next Hour .................................................................. 304 Introduction to Command Shells 305 Goals for This Hour ............................................................................... 305 Task 14.1: What Shells Are Available? ............................................... 306 Task 14.2: Identifying Your Shell ...................................................... 309 Task 14.3: How To Choose a New Shell ........................................... 310 Task 14.4: Learning the Shell Environment ....................................... 313 Task 14.5: Exploring csh Configuration Files ................................... 317 Summary ................................................................................................ 321 Workshop .............................................................................................. 321 Key Terms ......................................................................................... 321 Questions .......................................................................................... 321 Preview of the Next Hour .................................................................. 322 Contents 15 Getting the Most Out of the C Shell xi 323 Goals for This Hour ............................................................................... 323 Task 15.1: The C Shell and Korn Shell History Mechanisms ............ 324 Task 15.2: Using History to Cut Down on Typing ........................... 327 Task 15.3: Command Aliases ............................................................. 333 Task 15.4: Some Power Aliases .......................................................... 335 Task 15.5: Setting Custom Prompts .................................................. 338 Task 15.6: Creating Simple Shell Scripts ........................................... 340 Summary ................................................................................................ 344 Workshop .............................................................................................. 344 Key Terms ......................................................................................... 344 Questions .......................................................................................... 344 Preview of the Next Hour .................................................................. 345 16 17 18 Basic Shell Programming 347 Goals for This Hour ............................................................................... 347 Task 16.1: Shell Variables .................................................................. 348 Task 16.2: Shell Arithmetic ............................................................... 350 Task 16.3: Comparison Functions ..................................................... 351 Task 16.4: Conditional Expressions ................................................... 355 Task 16.5: Looping expressions ......................................................... 357 Summary ................................................................................................ 359 Workshop .............................................................................................. 359 Key Terms ......................................................................................... 360 Questions .......................................................................................... 360 Preview of the Next Hour .................................................................. 360 Job Control 361 Goals for This Hour ............................................................................... 361 Task 17.1: Job Control in the Shell: Stopping Jobs ............................ 362 Task 17.2: Foreground/Background and UNIX Programs ................. 365 Task 17.3: Finding Out What Tasks Are Running ............................ 368 Task 17.4: Terminating Processes with kill ..................................... 374 Summary ................................................................................................ 377 Workshop .............................................................................................. 377 Key Terms ......................................................................................... 377 Questions .......................................................................................... 378 Preview of the Next Hour .................................................................. 378 Printing in the UNIX Environment 379 Goals for This Hour ............................................................................... 379 Task 18.1: Find Local Printers with printers .................................. 380 Task 18.2: Printing Files with lpr or lp ............................................ 384 Task 18.3: Formatting Print Jobs with pr .......................................... 387 Task 18.4: Working with the Print Queue ........................................ 391 Teach Yourself UNIX in 24 Hours xii Summary ................................................................................................ 394 Workshop .............................................................................................. 394 Key Terms ......................................................................................... 395 Questions .......................................................................................... 395 Preview of the Next Hour .................................................................. 395 19 20 21 22 Searching for Information and Files 397 Goals for This Hour ............................................................................... 397 Task 19.1: The find Command and Its Weird Options .................... 398 Task 19.2: Using find with xargs .................................................... 403 Summary ................................................................................................ 405 Workshop .............................................................................................. 405 Questions .......................................................................................... 405 Preview of the Next Hour .................................................................. 406 Communicating with Others 407 Goals for This Hour ............................................................................... 407 Task 20.1: Enabling Messages Using mesg ......................................... 408 Task 20.2: Writing to Other Users with write .................................. 409 Task 20.3: Reading Electronic Mail with mailx ................................ 411 Task 20.4: Sending Mail with mailx ................................................. 417 Task 20.5: The Smarter Electronic Mail Alternative, elm .................. 420 Summary ................................................................................................ 423 Workshop .............................................................................................. 423 Key Terms ......................................................................................... 424 Questions .......................................................................................... 424 Preview of the Next Hour .................................................................. 424 Using Netscape To See the World Wide Web 425 Goals for This Hour ............................................................................... 425 Introduction to the Internet ................................................................... 426 Task 21.1: Starting Your Browser ...................................................... 427 Task 21.2: Finding Some Sites ........................................................... 432 Task 21.3: Customizing Your Browser ............................................... 437 Summary ................................................................................................ 440 Workshop .............................................................................................. 440 Key Terms ......................................................................................... 440 Questions .......................................................................................... 441 Preview of the Next Hour .................................................................. 441 Internet E-Mail, Netnews, and IRC 443 Goals for This Hour ............................................................................... 443 Task 22.1: Sending E-Mail to Internet Users ..................................... 444 Task 22.2: Talking with Remote Internet Users ................................ 446 Task 22.3: Searching Databases with WAIS ....................................... 449 Task 22.4: Having the Whole World with gopher ............................ 454 Contents xiii Task 22.5: Visiting Libraries Around the World ................................ 460 Task 22.6: All the News That’s Fit or Otherwise ............................... 466 Workshop .............................................................................................. 477 Key Terms ......................................................................................... 477 Questions .......................................................................................... 477 Preview of the Next Hour .................................................................. 478 23 24 Using telnet and ftp 479 Goals for This Hour ............................................................................... 479 Task 23.1: Connecting to Remote Internet Sites ................................ 480 Task 23.2: Copying Files from Other Internet Sites ........................... 483 Task 23.3: Finding Archives with archie .......................................... 493 Task 23.4: A Few Interesting telnet Sites ........................................ 499 Workshop .............................................................................................. 507 Key Terms ......................................................................................... 507 Questions .......................................................................................... 507 Preview of the Next Hour .................................................................. 507 Programming in C for UNIX 509 Goals for This Hour ............................................................................... 509 Task 24.1: Your First Program ........................................................... 510 Task 24.2: Basic Data Types and Operators ...................................... 512 Task 24.3: Conditional Statements .................................................... 517 Task 24.4: Looping Statements .......................................................... 520 Task 24.5: Functions ......................................................................... 521 Task 24.6: Arrays ............................................................................... 523 Task 24.7: Pointers ............................................................................ 524 Task 24.8: Structures ......................................................................... 526 Summary ................................................................................................ 528 Where To Go Next ................................................................................ 528 Workshop .............................................................................................. 529 Key Terms ......................................................................................... 529 Questions .......................................................................................... 530 Glossary 531 Index 541 ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.