⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch01_01.htm

📁 the unix power tools
💻 HTM
字号:
<HTML><!--Distributed by F --><HEAD><TITLE>[Chapter 1] Introduction</TITLE><METANAME="DC.title"CONTENT="UNIX Power Tools"><METANAME="DC.creator"CONTENT="Jerry Peek, Tim O'Reilly &amp; Mike Loukides"><METANAME="DC.publisher"CONTENT="O'Reilly &amp; Associates, Inc."><METANAME="DC.date"CONTENT="1998-08-04T21:30:52Z"><METANAME="DC.type"CONTENT="Text.Monograph"><METANAME="DC.format"CONTENT="text/html"SCHEME="MIME"><METANAME="DC.source"CONTENT="1-56592-260-3"SCHEME="ISBN"><METANAME="DC.language"CONTENT="en-US"><METANAME="generator"CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"><LINKREV="made"HREF="mailto:online-books@oreilly.com"TITLE="Online Books Comments"><LINKREL="up"HREF="index.htm"TITLE="UNIX Power Tools"><LINKREL="prev"HREF="prf1_14.htm"TITLE="Acknowledgments for the Second Edition "><LINKREL="next"HREF="ch01_02.htm"TITLE="1.2 Who Listens to What You Type? "></HEAD><BODYBGCOLOR="#FFFFFF"TEXT="#000000"><DIVCLASS="htmlnav"><H1><IMGSRC="gifs/smbanner.gif"ALT="UNIX Power Tools"USEMAP="#srchmap"BORDER="0"></H1><MAPNAME="srchmap"><AREASHAPE="RECT"COORDS="0,0,466,58"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="467,0,514,18"HREF="jobjects/fsearch.htm"ALT="Search this book"></MAP><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="prf1_14.htm"TITLE="Acknowledgments for the Second Edition "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: Acknowledgments for the Second Edition "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><B><FONTFACE="ARIEL,HELVETICA,HELV,SANSERIF"SIZE="-1">Chapter 1</FONT></B></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch01_02.htm"TITLE="1.2 Who Listens to What You Type? "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 1.2 Who Listens to What You Type? "BORDER="0"></A></TD></TR></TABLE>&nbsp;<HRALIGN="LEFT"WIDTH="515"TITLE="footer"></DIV><DIVCLASS="CHAPTER"><H1CLASS="chapter"><ACLASS="title"NAME="UPT-CHP-1">1. Introduction</A></H1><DIVCLASS="htmltoc"><P><B>Contents:</B><BR><ACLASS="sect1"HREF="#UPT-ART-1001"TITLE="1.1 What's Special About UNIX? ">What's Special About UNIX? </A><BR><ACLASS="sect1"HREF="ch01_02.htm"TITLE="1.2 Who Listens to What You Type? ">Who Listens to What You Type? </A><BR><ACLASS="sect1"HREF="ch01_03.htm"TITLE="1.3 Programs Are Designed to Work Together ">Programs Are Designed to Work Together </A><BR><ACLASS="sect1"HREF="ch01_04.htm"TITLE="1.4 Using Pipes to Create a New Tool ">Using Pipes to Create a New Tool </A><BR><ACLASS="sect1"HREF="ch01_05.htm"TITLE="1.5 Anyone Can Program the Shell ">Anyone Can Program the Shell </A><BR><ACLASS="sect1"HREF="ch01_06.htm"TITLE="1.6 Power Tools for Editing ">Power Tools for Editing </A><BR><ACLASS="sect1"HREF="ch01_07.htm"TITLE="1.7 Power Grows on You ">Power Grows on You </A><BR><ACLASS="sect1"HREF="ch01_08.htm"TITLE="1.8 There Are Many Shells ">There Are Many Shells </A><BR><ACLASS="sect1"HREF="ch01_09.htm"TITLE="1.9 Which Shell Am I Running? ">Which Shell Am I Running? </A><BR><ACLASS="sect1"HREF="ch01_10.htm"TITLE="1.10 Internal and External Commands ">Internal and External Commands </A><BR><ACLASS="sect1"HREF="ch01_11.htm"TITLE="1.11 How the Shell Executes Other Commands ">How the Shell Executes Other Commands </A><BR><ACLASS="sect1"HREF="ch01_12.htm"TITLE="1.12 What Makes a Shell Script? ">What Makes a Shell Script? </A><BR><ACLASS="sect1"HREF="ch01_13.htm"TITLE="1.13 Why Fundamentals Are Important ">Why Fundamentals Are Important </A><BR><ACLASS="sect1"HREF="ch01_14.htm"TITLE="1.14 The Kernel and Daemons ">The Kernel and Daemons </A><BR><ACLASS="sect1"HREF="ch01_15.htm"TITLE="1.15 Filenames ">Filenames </A><BR><ACLASS="sect1"HREF="ch01_16.htm"TITLE="1.16 Wildcards ">Wildcards </A><BR><ACLASS="sect1"HREF="ch01_17.htm"TITLE="1.17 Filename Extensions ">Filename Extensions </A><BR><ACLASS="sect1"HREF="ch01_18.htm"TITLE="1.18 Who Handles Wildcards? ">Who Handles Wildcards? </A><BR><ACLASS="sect1"HREF="ch01_19.htm"TITLE="1.19 The Tree Structure of the Filesystem ">The Tree Structure of the Filesystem </A><BR><ACLASS="sect1"HREF="ch01_20.htm"TITLE="1.20 Your Home Directory ">Your Home Directory </A><BR><ACLASS="sect1"HREF="ch01_21.htm"TITLE="1.21 Making Pathnames ">Making Pathnames </A><BR><ACLASS="sect1"HREF="ch01_22.htm"TITLE="1.22 How UNIX Keeps Track of Files: Inodes ">How UNIX Keeps Track of Files: Inodes </A><BR><ACLASS="sect1"HREF="ch01_23.htm"TITLE="1.23 File Access Permissions ">File Access Permissions </A><BR><ACLASS="sect1"HREF="ch01_24.htm"TITLE="1.24 The Superuser (Root) ">The Superuser (Root) </A><BR><ACLASS="sect1"HREF="ch01_25.htm"TITLE="1.25 Access to Directories ">Access to Directories </A><BR><ACLASS="sect1"HREF="ch01_26.htm"TITLE="1.26 What a Multiuser System Can Do for You ">What a Multiuser System Can Do for You </A><BR><ACLASS="sect1"HREF="ch01_27.htm"TITLE="1.27 How Background Processing Works ">How Background Processing Works </A><BR><ACLASS="sect1"HREF="ch01_28.htm"TITLE="1.28 Some Gotchas with Background Processing ">Some Gotchas with Background Processing </A><BR><ACLASS="sect1"HREF="ch01_29.htm"TITLE="1.29 When Is a File Not a File? ">When Is a File Not a File? </A><BR><ACLASS="sect1"HREF="ch01_30.htm"TITLE="1.30 Redirecting Input and Output ">Redirecting Input and Output </A><BR><ACLASS="sect1"HREF="ch01_31.htm"TITLE="1.31 The X Window System ">The X Window System </A><BR><ACLASS="sect1"HREF="ch01_32.htm"TITLE="1.32 One Big Hole ">One Big Hole </A><BR><ACLASS="sect1"HREF="ch01_33.htm"TITLE="1.33 UNIX Networking and Communications ">UNIX Networking and Communications </A><BR><ACLASS="sect1"HREF="ch01_34.htm"TITLE="1.34 What's Wrong with UNIX ">What's Wrong with UNIX </A></P><P></P></DIV><DIVCLASS="sect1"><H2CLASS="sect1"><ACLASS="title"NAME="UPT-ART-1001">1.1 What's Special About UNIX? </A></H2><PCLASS="para">If we were writing about any other operating system, &quot;powertools&quot; might mean &quot;nifty add-on utilities to extend the powerof your operating system.&quot;</P><PCLASS="para">That sounds suspiciously like a definition of UNIX: anoperating system loaded with 25 years' worth ofnifty add-on utilities.</P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-693"></A>UNIX is unique in thatit wasn't designed as a commercial operatingsystem meant to run application programs, but as a hacker'stoolset, by and for programmers. In fact, an early release of theoperating system went by the name PWB (Programmer'sWork Bench).</P><PCLASS="para">When Ken Thompson and Dennis Ritchie first wrote UNIX at AT&amp;TBell Labs, it wasfor their own use, and for their friends and co-workers.Utility programs were added by various people as they hadproblems to solve. Because Bell Labs wasn't in the computerbusiness, source code was given out to universities for anominal fee. Brilliant researchers wrote their own softwareand added it to UNIX in a spree of creative anarchy that hasn'tbeen equaled since, except perhaps in the introductionof the<SPANCLASS="link">X Window System (<ACLASS="linkend"HREF="ch01_31.htm"TITLE="The X Window System ">1.31</A>)</SPAN>.</P><PCLASS="para">Unlike most other operating systems, where free softwareremains an unsupported add-on, UNIX has taken as its own thework of thousands of independent programmers. During thecommercialization of UNIX within the past ten years, thisincorporation of outside software has slowed down, but notstopped entirely, especially in the university environment.</P><PCLASS="para">A book on UNIX Power Tools&#174; therefore inevitably <EMCLASS="emphasis">has</EM>to focus not just on add-on utilities (though we do includemany of those) but on how to use clever features of the manyutilities that have been made part of UNIX over the years.</P><PCLASS="para">UNIX is also important to power users because it's one of the lastpopular operating systems that doesn't force you to work behind aninterface of menus and windows and a mouse witha &quot;one-size(-doesn't)-fit-all&quot; programming interface.Yes, you can use UNIX interfaces with windows and menus&nbsp;- andthey can be great time savers in a lot of cases.But UNIX also gives you building blocks that, with some training andpractice, will give you many more choices than any software designercan cram onto a set of menus.If you learn to use UNIX and its utilities from the command line,you don't have to be a programmer to do very powerful things witha few keystrokes.</P><PCLASS="para">So, it's also essential that this book teach you some of theunderlying principles that make UNIX such a tinkerer's paradise.</P><PCLASS="para">In the body of this book, we assume that you are alreadymoderately familiar with UNIX-a journeyman hacker wanting tobecome a master. But at the same time, we don't want to leavebeginners entirely at sea, so in this chapter, we include somefundamental concepts. We've tried to intersperse some simple tips andtricks to keep things interesting, but the ratio of conceptarticles to tips is much higher than in any other part ofthe book. The concepts covered are also much more basic. Ifyou aren't a beginner, you can safely skip this chapter, thoughwe may bounce you back here if you don't understand somethinglater in the book.</P><PCLASS="para">Don't expect a complete introduction to UNIX-if you need that,buy an introductory book. What you'll find here is a selectionof key concepts that you'll need to understand to progress beyond the beginnerstage, and answers to frequently asked questions and problems.In some ways, consider this introduction a teaser. If youare a beginner, we wantto show you enough of UNIX to whet your appetite for more.</P><PCLASS="para">Also, don't expect everything to be in order. Because we don'twant you to get in the habit of reading through each chapterfrom beginning to end, as in most books, the articles in thischapter are in loose order. We've tried not to make you jumparound too much, but we've also avoided a lot of thetransitional material that makes reading most books a chore.</P><DIVCLASS="sect1info"><PCLASS="SECT1INFO">- <SPANCLASS="authorinitials">TOR</SPAN>, <SPANCLASS="authorinitials">JP</SPAN></P></DIV></DIV></DIV><DIVCLASS="htmlnav"><P></P><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="prf1_14.htm"TITLE="Acknowledgments for the Second Edition "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: Acknowledgments for the Second Edition "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="book"HREF="index.htm"TITLE="UNIX Power Tools"><IMGSRC="gifs/txthome.gif"SRC="gifs/txthome.gif"ALT="UNIX Power Tools"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch01_02.htm"TITLE="1.2 Who Listens to What You Type? "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 1.2 Who Listens to What You Type? "BORDER="0"></A></TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172">Acknowledgments for the Second Edition </TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="index"HREF="index/idx_0.htm"TITLE="Book Index"><IMGSRC="gifs/index.gif"SRC="gifs/index.gif"ALT="Book Index"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172">1.2 Who Listens to What You Type? </TD></TR></TABLE><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><IMGSRC="gifs/smnavbar.gif"SRC="gifs/smnavbar.gif"USEMAP="#map"BORDER="0"ALT="The UNIX CD Bookshelf Navigation"><MAPNAME="map"><AREASHAPE="RECT"COORDS="0,0,73,21"HREF="../index.htm"ALT="The UNIX CD Bookshelf"><AREASHAPE="RECT"COORDS="74,0,163,21"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="164,0,257,21"HREF="../unixnut/index.htm"ALT="UNIX in a Nutshell"><AREASHAPE="RECT"COORDS="258,0,321,21"HREF="../vi/index.htm"ALT="Learning the vi Editor"><AREASHAPE="RECT"COORDS="322,0,378,21"HREF="../sedawk/index.htm"ALT="sed &amp; awk"><AREASHAPE="RECT"COORDS="379,0,438,21"HREF="../ksh/index.htm"ALT="Learning the Korn Shell"><AREASHAPE="RECT"COORDS="439,0,514,21"HREF="../lrnunix/index.htm"ALT="Learning the UNIX Operating System"></MAP></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -