📄 ch19_05.htm
字号:
<html><head><title>Alphabetical Summary of Commands (UNIX in a Nutshell: System V Edition)</title><link rel="stylesheet" type="text/css" href="../style/style1.css" /><meta name="DC.Creator" content="Arnold Robbins" /><meta name="DC.Format" content="text/xml" scheme="MIME" /><meta name="DC.Language" content="en-US" /><meta name="DC.Publisher" content="O'Reilly & Associates, Inc." /><meta name="DC.Source" scheme="ISBN" content="1-56592-427-4" /><meta name="DC.Subject.Keyword" content="stuff" /><meta name="DC.Title" content="UNIX in a Nutshell: System V Edition" /><meta name="DC.Type" content="Text.Monograph" /></head><body bgcolor="#ffffff"><img src="gifs/smbanner.gif" usemap="#banner-map" border="0" alt="Book Home" /><map name="banner-map"><area shape="rect" coords="1,-2,616,66" href="index.htm" alt="Book Title" /><area shape="rect" coords="629,-11,726,25" href="jobjects/fsearch.htm" alt="Search this book" /></map><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="ch19_04.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td align="center" valign="top" width="228" /><td align="right" valign="top" width="228"><a href="ch20_01.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr></table></div><h2 class="sect1">19.5. Alphabetical Summary of Commands</h2><p><a name="ch19rcs1" /><a name="ch19rcs2" />For details on the syntax of keywords, revision numbers,dates, states, and standard options, refer to the previous discussions.</p><table border="1" cellpadding="5"><tr><td valign="top"><a name="ci">ci</a></td><td><p><tt class="literal">ci</tt> [<em class="replaceable"><tt>options</em>] <em class="replaceable">files</tt></em></p><p><a name="IXT-19-123587" /><a name="IXT-19-123588" /><a name="IXT-19-123589" />Check in revisions. <tt class="literal">ci</tt> stores the contents of the specified working<em class="emphasis">files</em> into their corresponding RCS files.Normally, <tt class="literal">ci</tt> deletes the working file after storing it.If no RCS file exists, the working file is an initial revision.In this case, the RCS file is created, and you areprompted to enter a description of the file.If an RCS file exists, <tt class="literal">ci</tt> increments the revision numberand prompts you to enter a message that logs the changes made.Ifa working file is checked in without changes,the file reverts to the previous revision.</p><p>The two mutually exclusive options <tt class="literal">-u</tt> and <tt class="literal">-l</tt>,along with <tt class="literal">-r</tt>,are the most common.Use <tt class="literal">-u</tt> to keep a read-only copy of the working file (for example, so the file can be compiled or searched).Use <tt class="literal">-l</tt> to update a revision and then immediately check it outagain with a lock. This allows you to save intermediatechanges but continue editing (for example, during a long editing session). Use <tt class="literal">-r</tt> to check in a file with a differentrelease number.<tt class="literal">ci</tt> accepts the standard options<tt class="literal">-q</tt>,<tt class="literal">-V</tt>,<tt class="literal">-V</tt><em class="emphasis">n</em>,<tt class="literal">-T</tt>,<tt class="literal">-x</tt>,and<tt class="literal">-z</tt>.</p><h4 class="refsect2">Options</h4><dl><dt><tt class="literal">-d</tt>[<tt><em class="replaceable">date</em></tt>]</dt><dd>Check the file in with a timestamp of <em class="emphasis">date</em></tt> or,if no date is specified,with the time of last modification.</p></dd><dt><tt class="literal">-f</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Force a check-in even if there are no differences.</p></dd><dt><tt class="literal">-i</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Initial check-in, report an error if the RCS file already exists.</p></dd><dt><tt class="literal">-I</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Interactive mode; prompt user even when standard input isnot a terminal (e.g., when <tt class="literal">ci</tt> is part of a command pipeline).</p></dd><dt><tt class="literal">-j</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Just check in and do not initialize. Report an error if the RCS filedoes not already exist.</p></dd><dt><tt class="literal">-k</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Assign a revision number, creation date, state, and authorfrom keyword values that were placed in the working file, instead ofcomputing the revision information from the local environment. <tt class="literal">-k</tt> is useful for software distribution: the preset keywords serve as a timestamp shared by all distribution sites.</p></dd><dt><tt class="literal">-l</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Do a <tt class="literal">co -l</tt> after checking in. This leaves a locked copyof the next revision.</p></dd><dt><tt class="literal">-m</tt><tt><em class="replaceable">msg</em></tt></dt><dd>Use the <em class="emphasis">msg</em></tt> string as the log message for all files checked in.When checking in multiple files, <tt class="literal">ci</tt> normally promptswhether to reuse the log message of the previous file.<tt class="literal">-m</tt> bypasses this prompting.</p></dd><dt><tt class="literal">-M</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Set the working file's modification time to that of the retrieved version.Use of <tt class="literal">-M</tt> can confuse <tt class="literal">make</tt> and should be used with care.</p></dd><dt><tt class="literal">-n</tt><tt><em class="replaceable">name</em></tt></dt><dd>Associate a text <em class="emphasis">name</em></tt> with the new revision number.</p></dd><dt><tt class="literal">-N</tt><tt><em class="replaceable">name</em></tt></dt><dd>Same as <tt class="literal">-n</tt>, but override a previous <em class="emphasis">name</em></tt>.</p></dd><dt><tt class="literal">-r</tt><tt><em class="replaceable">R</em></tt></dt><dd>Check the file in as revision <em class="emphasis">R</em></tt>.</p></dd><dt><tt class="literal">-r</tt></dt><dd>Without a revision number, <tt class="literal">-r</tt> restores the default behaviorof releasing a lock and removing the working file.It is intended to override any default <tt class="literal">-l</tt> or <tt class="literal">-u</tt>set up by aliases or scripts.The behavior of <tt class="literal">-r</tt> in <tt class="literal">ci</tt> is different from mostother RCS commands.</p></dd><dt><tt class="literal">-s</tt><tt><em class="replaceable">state</em></tt></dt><dd>Set the <em class="emphasis">state</em></tt> of the checked-in revision. </p></dd><dt><tt class="literal">-t</tt><tt><em class="replaceable">file</em></tt></dt><dd>Replace RCS file description with contents of <em class="emphasis">file</em></tt>.Thisworks only for initial check-in.</p></dd><dt><tt class="literal">-t-</tt><tt><em class="replaceable">string</em></tt></dt><dd>Replace RCS file description with <em class="emphasis">string</em></tt>.Thisworks only for initial check-in.</p></dd><dt><tt class="literal">-u</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Do a <tt class="literal">co -u</tt> after checking in. This leaves a read-only copy.</p></dd><dt><tt class="literal">-w</tt><tt><em class="replaceable">user</em></tt></dt><dd>Set the author field to <em class="emphasis">user</em></tt> in the checked-in revision.</p></dd></dl><h4 class="refsect2">Examples</h4><p>Check in chapter files using the same log message:</p><blockquote><pre class="code"><tt class="userinput"><b>ci -m'First round edits' chap*</b></tt></pre></blockquote><p>Check in edits to <tt class="literal">prog.c</tt>, leaving a read-only copy:</p><blockquote><pre class="code"><tt class="userinput"><b>ci -u prog.c</b></tt></pre></blockquote><p>Start revision level 2; refer to revision 2.1 as “Prototype”:</p><blockquote><pre class="code"><tt class="userinput"><b>ci -r2 -nPrototype prog.c</b></tt></pre></blockquote></td></tr><tr><td valign="top"><a name="co">co</a></td><td><p><tt class="literal">co</tt> [<em class="replaceable"><tt>options</em>] <em class="replaceable">files</tt></em></p><p><a name="IXT-19-123590" /><a name="IXT-19-123591" /><a name="IXT-19-123592" />Retrieve (check out) a previously checked-in revisionand place it in the corresponding working file(or print to standard output if <tt class="literal">-p</tt> is specified).If you intend to edit the working file and check it in again,specify <tt class="literal">-l</tt> to lock the file.<tt class="literal">co</tt> accepts the standard options<tt class="literal">-q</tt>,<tt class="literal">-V</tt>,<tt class="literal">-V</tt><em class="emphasis">n</em>,<tt class="literal">-T</tt>,<tt class="literal">-x</tt>,and<tt class="literal">-z</tt>.</p><h4 class="refsect2">Options</h4><dl><dt><tt class="literal">-d</tt><tt><em class="replaceable">date</em></tt></dt><dd>Retrieve latest revision whose check-in timestamp is on or before <em class="emphasis">date</em></tt>.</p></dd><dt><tt class="literal">-f</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Force the working file to be overwritten.</p></dd><dt><tt class="literal">-I</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Interactive mode; prompt user even when standard input is not a terminal.</p></dd><dt><tt class="literal">-j</tt><tt><em class="replaceable">R2</em></tt><tt class="literal">:</tt><tt><em class="replaceable">R3</em></tt>[<tt class="literal">,</tt>...]</dt><dd>This works like <tt class="literal">rcsmerge</tt>.<em class="emphasis">R2</em> and <em class="emphasis">R3</em> specify two revisions whose changes are mergedinto a third file: either the corresponding working fileor a third revision (any <em class="emphasis">R</em> specified by other <tt class="literal">co</tt> options).Multiple comma-separated pairs may be provided; the output of the first joinbecomes the input of the next.See the <tt class="literal">co</tt> manpage for more details.</p></dd><dt><tt class="literal">-k</tt><tt><em class="replaceable">c</em></tt></dt><dd>Expand keyword symbols according to flag <em class="emphasis">c</em></tt>. <em class="emphasis">c</em></tt> can be:</p></dd></dl><table border="1" cellpadding="3"><tr><td><tt class="literal">b</tt></td><td><p>Like <tt class="literal">-ko</tt>, but uses binary I/O.This is most useful on non-Unix systems.</p></td></tr><tr><td><tt class="literal">kv</tt></td><td><p>Expand symbols to keyword and value (the default).Insert the locker's name only duringa <tt class="literal">ci -l</tt> or <tt class="literal">co -l</tt>.</p></td></tr><tr><td><tt class="literal">kvl</tt></td><td><p>Like <tt class="literal">kv</tt>, but always insert the locker's name.</p></td></tr><tr><td><tt class="literal">k</tt></td><td><p>Expand symbols to keywords only (no values). This is usefulfor ignoring trivial differences during file comparison.</p></td></tr><tr><td><tt class="literal">o</tt></td><td><p>Expand symbols to keyword and value present in previous revision.This is useful for binary files that don't allow substring changes.</p></td></tr><tr><td><tt class="literal">v</tt></td><td><p>Expand symbols to values only (no keywords).This prevents further keyword substitution and is not recommended.</p></td></tr></table><p><dl><dt><tt class="literal">-l</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Same as <tt class="literal">-r</tt>, but also lock the retrieved revision.</p></dd><dt><tt class="literal">-M</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Set the working file's modification time to that of the retrieved version.Use of <tt class="literal">-M</tt> can confuse <tt class="literal">make</tt> and should be used with care.</p></dd><dt><tt class="literal">-p</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Send retrieved revision to standard output instead of to a working file.Useful for output redirection or filtering.</p></dd><dt><tt class="literal">-r</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Retrieve the latest revision or, if <em class="emphasis">R</em></tt> is given,retrieve the latest revision that is equal to or lower than <em class="emphasis">R</em></tt>.If <em class="emphasis">R</em></tt> is <tt class="literal">$</tt>, retrieve the versionspecified by the keywords in the working file.</p></dd><dt><tt class="literal">-s</tt><tt><em class="replaceable">state</em></tt></dt><dd>Retrieve the latest revision having the given <em class="emphasis">state</em></tt>.</p></dd><dt><tt class="literal">-u</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Same as <tt class="literal">-r</tt>, but also unlock the retrieved revisionif you locked it previously.</p></dd><dt><tt class="literal">-w</tt>[<tt><em class="replaceable">user</em></tt>]</dt><dd>Retrieve the latest revision that was checked in eitherby the invoking user or by the specified <em class="emphasis">user</em>.</p></dd></dl><h4 class="refsect2">Examples</h4><p>Sort the latest stored version of <em class="emphasis">file</em>:</p><blockquote><pre class="code"><tt class="userinput"><b>co -p </b></tt><em class="replaceable"><tt>file</tt></em> <tt class="userinput"><b>| sort</b></tt></pre></blockquote><p>Check out (and lock) all uppercase filenames for editing:</p><blockquote><pre class="code"><tt class="userinput"><b>co -l [A-Z]*</b></tt></pre></blockquote><p>Note that filename expansionfails unless a working copy resides in the current directory.Therefore, this example works only if the files were previouslychecked in via <tt class="literal">ci -u</tt>.Finally, here are some different ways to extract the working filesfor a set of RCS files (in the current directory):</p><blockquote><pre class="code"><tt class="userinput"><b>co -r3 *,v </b></tt> <i class="lineannotation">Latest revisions of release 3</i><tt class="userinput"><b>co -r3 -wjim *,v </b></tt> <i class="lineannotation">Same, but only if checked in by jim</i><tt class="userinput"><b>co -d'May 5, 2 pm LT' *,v </b></tt> <i class="lineannotation">Latest revisions that were modified on or before the date</i><tt class="userinput"><b>co -rPrototype *,v </b></tt> <i class="lineannotation">Latest revisions named Prototype</i></pre></blockquote></td></tr><tr><td valign="top"><a name="ident">ident</a></td><td><p><tt class="literal">ident</tt> [<em class="replaceable"><tt>options</em>] [<em class="replaceable">files</tt></em>]</p><p><a name="IXT-19-123593" />Extract keyword/value symbols from <em class="emphasis">files</em>.<em class="emphasis">files</em> can be text files, object files, or dumps.<tt class="literal">ident</tt> accepts the standard option<tt class="literal">-V</tt>.</p><h4 class="refsect2">Options</h4><dl><dt><tt class="literal">-q</tt></dt><dd>Suppress warning message when no keyword patterns are found.</p></dd><dt><tt class="literal">-V</tt></dt><dd>Print the version number of <tt class="literal">ident</tt>.</p></dd>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -