📄 ch16_05.htm
字号:
<HTML><!--Distributed by F --><HEAD><TITLE>[Chapter 16] 16.5 The Three UNIX File Times </TITLE><METANAME="DC.title"CONTENT="UNIX Power Tools"><METANAME="DC.creator"CONTENT="Jerry Peek, Tim O'Reilly & Mike Loukides"><METANAME="DC.publisher"CONTENT="O'Reilly & Associates, Inc."><METANAME="DC.date"CONTENT="1998-08-04T21:37:38Z"><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="ch16_01.htm"TITLE="16. Where Did I Put That?"><LINKREL="prev"HREF="ch16_04.htm"TITLE="16.4 List All Subdirectories with ls -R "><LINKREL="next"HREF="ch16_06.htm"TITLE='16.6 clf, cls: "Compressed" ls Listings'></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="ch16_04.htm"TITLE="16.4 List All Subdirectories with ls -R "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 16.4 List All Subdirectories with ls -R "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><B><FONTFACE="ARIEL,HELVETICA,HELV,SANSERIF"SIZE="-1">Chapter 16<BR>Where Did I Put That?</FONT></B></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch16_06.htm"TITLE='16.6 clf, cls: "Compressed" ls Listings'><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT='Next: 16.6 clf, cls: "Compressed" ls Listings'BORDER="0"></A></TD></TR></TABLE> <HRALIGN="LEFT"WIDTH="515"TITLE="footer"></DIV><DIVCLASS="SECT1"><H2CLASS="sect1"><ACLASS="title"NAME="UPT-ART-0379">16.5 The Three UNIX File Times </A></H2><PCLASS="para">When you're talking to experienced UNIX users, you often hear the terms"change time" and "modification time" thrown around cavalierly.To most people (and most dictionaries), a change and amodification are the same thing. What's the difference here?</P><PCLASS="para">The difference between a change and a modificationis the difference between altering the label on a package andaltering its contents. If someone says <EMCLASS="emphasis">chmod a-w myfile</EM>, thatis a change; if someone says <EMCLASS="emphasis">echo foo >> myfile</EM>, that is amodification.<ACLASS="indexterm"NAME="AUTOID-16855"></A><ACLASS="indexterm"NAME="AUTOID-16857"></A>A change modifies the file's<SPANCLASS="link">inode (<ACLASS="linkend"HREF="ch01_22.htm"TITLE="How UNIX Keeps Track of Files: Inodes ">1.22</A>)</SPAN>;a modification modifies thecontents of the file itself.[A file's modification time is also called the <EMCLASS="emphasis">timestamp</EM>. -<EMCLASS="emphasis">JP</EM> ]<ACLASS="indexterm"NAME="AUTOID-16863"></A><ACLASS="indexterm"NAME="AUTOID-16865"></A><ACLASS="indexterm"NAME="AUTOID-16868"></A><ACLASS="indexterm"NAME="AUTOID-16870"></A></P><PCLASS="para">As long as we're talking about change times and modification<ACLASS="indexterm"NAME="AUTOID-16875"></A><ACLASS="indexterm"NAME="AUTOID-16878"></A>times, we might as well mention "access times," too. The accesstime is the last time the file was read or written. So reading afile updates its access time, but not its change time (informationabout the file wasn't changed) or its modification time (the fileitself wasn't changed).</P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-16882"></A>Incidentally, the change time or "ctime" is incorrectly documentedas the "creation time" in many places, including some UNIX manuals.Do not believe them.</P><DIVCLASS="sect1info"><PCLASS="SECT1INFO">- <SPANCLASS="authorinitials">CT</SPAN></P></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="ch16_04.htm"TITLE="16.4 List All Subdirectories with ls -R "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 16.4 List All Subdirectories with ls -R "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="ch16_06.htm"TITLE='16.6 clf, cls: "Compressed" ls Listings'><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT='Next: 16.6 clf, cls: "Compressed" ls Listings'BORDER="0"></A></TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172">16.4 List All Subdirectories with ls -R </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">16.6 clf, cls: "Compressed" ls Listings</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 & 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 + -