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

📄 ch18_01.htm

📁 the unix power tools
💻 HTM
字号:
<HTML><!--Distributed by F --><HEAD><TITLE>[Chapter 18] Linking, Renaming, and Copying Files</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:38:51Z"><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="part03.htm"TITLE="III. Working with the Filesystem "><LINKREL="prev"HREF="ch17_25.htm"TITLE="17.25 Keeping find From Searching Networked Filesystems"><LINKREL="next"HREF="ch18_02.htm"TITLE="18.2 What's Really in a Directory "></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="ch17_25.htm"TITLE="17.25 Keeping find From Searching Networked Filesystems"><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 17.25 Keeping find From Searching Networked Filesystems"BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><B><FONTFACE="ARIEL,HELVETICA,HELV,SANSERIF"SIZE="-1">Chapter 18</FONT></B></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch18_02.htm"TITLE="18.2 What's Really in a Directory "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 18.2 What's Really in a Directory "BORDER="0"></A></TD></TR></TABLE>&nbsp;<HRALIGN="LEFT"WIDTH="515"TITLE="footer"></DIV><DIVCLASS="CHAPTER"><H1CLASS="chapter"><ACLASS="title"NAME="UPT-CHP-18">18. Linking, Renaming, and Copying Files</A></H1><DIVCLASS="htmltoc"><P><B>Contents:</B><BR><ACLASS="sect1"HREF="#UPT-ART-8022"TITLE="18.1 What's So Complicated About Copying Files? ">What's So Complicated About Copying Files? </A><BR><ACLASS="sect1"HREF="ch18_02.htm"TITLE="18.2 What's Really in a Directory ">What's Really in a Directory </A><BR><ACLASS="sect1"HREF="ch18_03.htm"TITLE="18.3 Files with Two or More Names">Files with Two or More Names</A><BR><ACLASS="sect1"HREF="ch18_04.htm"TITLE="18.4 More About Links ">More About Links </A><BR><ACLASS="sect1"HREF="ch18_05.htm"TITLE="18.5 Creating and Removing Links ">Creating and Removing Links </A><BR><ACLASS="sect1"HREF="ch18_06.htm"TITLE="18.6 Stale Symbolic Links ">Stale Symbolic Links </A><BR><ACLASS="sect1"HREF="ch18_07.htm"TITLE="18.7 Linking Directories ">Linking Directories </A><BR><ACLASS="sect1"HREF="ch18_08.htm"TITLE="18.8 Showing the Actual Filenames for Symbolic Links ">Showing the Actual Filenames for Symbolic Links </A><BR><ACLASS="sect1"HREF="ch18_09.htm"TITLE="18.9 Renaming, Copying, or Comparing a Set of Files ">Renaming, Copying, or Comparing a Set of Files </A><BR><ACLASS="sect1"HREF="ch18_10.htm"TITLE="18.10 There's More than One Way to Do It ">There's More than One Way to Do It </A><BR><ACLASS="sect1"HREF="ch18_11.htm"TITLE="18.11 Renaming Files with ren ">Renaming Files with ren </A><BR><ACLASS="sect1"HREF="ch18_12.htm"TITLE="18.12 Renaming a List of Files Interactively ">Renaming a List of Files Interactively </A><BR><ACLASS="sect1"HREF="ch18_13.htm"TITLE="18.13 One More Way to Do It ">One More Way to Do It </A><BR><ACLASS="sect1"HREF="ch18_14.htm"TITLE="18.14 Relinking Multiple Symbolic Links ">Relinking Multiple Symbolic Links </A><BR><ACLASS="sect1"HREF="ch18_15.htm"TITLE="18.15 Copying Directory Trees with cp -r ">Copying Directory Trees with cp -r </A><BR><ACLASS="sect1"HREF="ch18_16.htm"TITLE="18.16 Copying Directory Trees with (tar | tar) ">Copying Directory Trees with (tar | tar) </A></P><P></P></DIV><DIVCLASS="sect1"><H2CLASS="sect1"><ACLASS="title"NAME="UPT-ART-8022">18.1 What's So Complicated About Copying Files? </A></H2><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-20051"></A><ACLASS="indexterm"NAME="AUTOID-20054"></A>It hardly seems that there should be enough material to fill anentire chapter with information about linking, moving, and copying files.There are several things that make the topic more complex (and more interesting) than you might expect:</P><ULCLASS="itemizedlist"><LICLASS="listitem"><PCLASS="para">In addition to moving and copying files, UNIX systems also allow youto link them&nbsp;- to have two filenames, perhaps in different directoriesor even on different filesystems, that point to the same file.We talk about why you'd want to do that (article<ACLASS="xref"HREF="ch18_03.htm"TITLE="Files with Two or More Names">18.3</A>),the difference between &quot;hard&quot; and &quot;soft&quot; links (article<ACLASS="xref"HREF="ch18_04.htm"TITLE="More About Links ">18.4</A>),how to create links (article<ACLASS="xref"HREF="ch18_05.htm"TITLE="Creating and Removing Links ">18.5</A>),and various issues that can come up when using links (articles<ACLASS="xref"HREF="ch18_06.htm"TITLE="Stale Symbolic Links ">18.6</A>,<ACLASS="xref"HREF="ch18_07.htm"TITLE="Linking Directories ">18.7</A>,and<ACLASS="xref"HREF="ch18_08.htm"TITLE="Showing the Actual Filenames for Symbolic Links ">18.8</A>).</P></LI><LICLASS="listitem"><PCLASS="para">It is non-trivial to rename a group of files all at once, but asusual, UNIX provides many ways to circumvent the tedium of renaming files one by one.We show you many different ways to dothis, exploring the variety in the UNIX toolbox along the way.</P></LI><LICLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-20070"></A><ACLASS="indexterm"NAME="AUTOID-20072"></A>In a hierarchical filesystem, you're sometimes faced with theproblem of moving not only files but entire directory hierarchiesfrom one place to another.Articles<ACLASS="xref"HREF="ch18_15.htm"TITLE="Copying Directory Trees with cp -r ">18.15</A>and <ACLASS="xref"HREF="ch18_16.htm"TITLE="Copying Directory Trees with (tar | tar) ">18.16</A>show you two ways to do that.Of course, this discussion starts toget into the territory covered by the next two chapters.Chapter&nbsp;19covers &quot;archives&quot;-large files that include many other files anddirectories, with instructions for recreating copies of the original filesand directories.Chapter&nbsp;20 covers backups&nbsp;- which are typicallyarchive files copied to tape.</P></LI></UL><DIVCLASS="sect1info"><PCLASS="SECT1INFO">- <SPANCLASS="authorinitials">TOR</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="ch17_25.htm"TITLE="17.25 Keeping find From Searching Networked Filesystems"><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 17.25 Keeping find From Searching Networked Filesystems"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="ch18_02.htm"TITLE="18.2 What's Really in a Directory "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 18.2 What's Really in a Directory "BORDER="0"></A></TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172">17.25 Keeping find From Searching Networked Filesystems</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">18.2 What's Really in a Directory </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 + -