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

📄 pax.html

📁 IEEE 1003.1-2003, Single Unix Specification v3
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title>pax</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="pax"></a> <a name="tag_04_100"></a><!-- pax --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright &copy; 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_04_100_01"></a>NAME</h4><blockquote>pax - portable archive interchange</blockquote><h4><a name="tag_04_100_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><p><code><tt>pax</tt> <b>[</b><tt>-cdnv</tt><b>][</b><tt>-H|-L</tt><b>][</b><tt>-f</tt> <i>archive</i><b>][</b><tt>-s</tt><i>replstr</i><b>]</b><tt>...</tt><b>[</b><i>pattern</i><tt>...</tt><b>]</b><tt><br><br>pax -r</tt><b>[</b><tt>-cdiknuv</tt><b>][</b><tt>-H|-L</tt><b>][</b><tt>-f</tt> <i>archive</i><b>][</b><tt>-o</tt><i>options</i><b>]</b><tt>...</tt><b>[</b><tt>-p</tt> <i>string</i><b>]</b><tt>...<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt> <b>[</b><tt>-s</tt><i>replstr</i><b>]</b><tt>...</tt><b>[</b><i>pattern</i><tt>...</tt><b>]</b><tt><br><br>pax -w</tt><b>[</b><tt>-dituvX</tt><b>][</b><tt>-H|-L</tt><b>][</b><tt>-b</tt><i>blocksize</i><b>][[</b><tt>-a</tt><b>][</b><tt>-f</tt> <i>archive</i><b>][</b><tt>-o</tt> <i>options</i><b>]</b><tt>...<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt> <b>[</b><tt>-s</tt> <i>replstr</i><b>]</b><tt>...</tt><b>[</b><tt>-x</tt><i>format</i><b>][</b><i>file</i><tt>...</tt><b>]</b><tt><br><br>pax -r -w</tt><b>[</b><tt>-diklntuvX</tt><b>][</b><tt>-H|-L</tt><b>][</b><tt>-p</tt><i>string</i><b>]</b><tt>...</tt><b>[</b><tt>-s</tt> <i>replstr</i><b>]</b><tt>...<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt> <b>[</b><i>file</i><tt>...</tt><b>]</b> <i>directory</i><tt><br></tt></code></p></blockquote><h4><a name="tag_04_100_03"></a>DESCRIPTION</h4><blockquote><p>The <i>pax</i> utility shall read, write, and write lists of the members of archive files and copy directory hierarchies. Avariety of archive formats shall be supported; see the <b>-x</b> <i>format</i> option.</p><p>The action to be taken depends on the presence of the <b>-r</b> and <b>-w</b> options. The four combinations of <b>-r</b> and<b>-w</b> are referred to as the four modes of operation: <b>list</b>, <b>read</b>, <b>write</b>, and <b>copy</b> modes,corresponding respectively to the four forms shown in the SYNOPSIS section.</p><dl compact><dt><b>list</b></dt><dd>In <b>list</b> mode (when neither <b>-r</b> nor <b>-w</b> are specified), <i>pax</i> shall write the names of the members ofthe archive file read from the standard input, with pathnames matching the specified patterns, to standard output. If a named fileis of type directory, the file hierarchy rooted at that file shall be listed as well.</dd><dt><b>read</b></dt><dd>In <b>read</b> mode (when <b>-r</b> is specified, but <b>-w</b> is not), <i>pax</i> shall extract the members of the archivefile read from the standard input, with pathnames matching the specified patterns. If an extracted file is of type directory, thefile hierarchy rooted at that file shall be extracted as well. The extracted files shall be created performing pathname resolutionwith the directory in which <i>pax</i> was invoked as the current working directory. <p>If an attempt is made to extract a directory when the directory already exists, this shall not be considered an error. If anattempt is made to extract a FIFO when the FIFO already exists, this shall not be considered an error.</p><p>The ownership, access, and modification times, and file mode of the restored files are discussed under the <b>-p</b> option.</p></dd><dt><b>write</b></dt><dd>In <b>write</b> mode (when <b>-w</b> is specified, but <b>-r</b> is not), <i>pax</i> shall write the contents of the<i>file</i> operands to the standard output in an archive format. If no <i>file</i> operands are specified, a list of files tocopy, one per line, shall be read from the standard input. A file of type directory shall include all of the files in the filehierarchy rooted at the file.</dd><dt><b>copy</b></dt><dd>In <b>copy</b> mode (when both <b>-r</b> and <b>-w</b> are specified), <i>pax</i> shall copy the <i>file</i> operands to thedestination directory. <p>If no <i>file</i> operands are specified, a list of files to copy, one per line, shall be read from the standard input. A fileof type directory shall include all of the files in the file hierarchy rooted at the file.</p><p>The effect of the <b>copy</b> shall be as if the copied files were written to an archive file and then subsequently extracted,except that there may be hard links between the original and the copied files. If the destination directory is a subdirectory ofone of the files to be copied, the results are unspecified. If the destination directory is a file of a type not defined by theSystem Interfaces volume of IEEE&nbsp;Std&nbsp;1003.1-2001, the results are implementation-defined; otherwise, it shall be an errorfor the file named by the <i>directory</i> operand not to exist, not be writable by the user, or not be a file of typedirectory.</p></dd></dl><p>In <b>read</b> or <b>copy</b> modes, if intermediate directories are necessary to extract an archive member, <i>pax</i> shallperform actions equivalent to the <a href="../functions/mkdir.html"><i>mkdir</i>()</a> function defined in the System Interfacesvolume of IEEE&nbsp;Std&nbsp;1003.1-2001, called with the following arguments:</p><ul><li><p>The intermediate directory used as the <i>path</i> argument</p></li><li><p>The value of the bitwise-inclusive OR of S_IRWXU, S_IRWXG, and S_IRWXO as the <i>mode</i> argument</p></li></ul><p>If any specified <i>pattern</i> or <i>file</i> operands are not matched by at least one file or archive member, <i>pax</i> shallwrite a diagnostic message to standard error for each one that did not match and exit with a non-zero exit status.</p><p>The archive formats described in the EXTENDED DESCRIPTION section shall be automatically detected on input. The default outputarchive format shall be implementation-defined.</p><p>A single archive can span multiple files. The <i>pax</i> utility shall determine, in an implementation-defined manner, what fileto read or write as the next file.</p><p>If the selected archive format supports the specification of linked files, it shall be an error if these files cannot be linkedwhen the archive is extracted. For archive formats that do not store file contents with each name that causes a hard link, if thefile that contains the data is not extracted during this <i>pax</i> session, either the data shall be restored from the originalfile, or a diagnostic message shall be displayed with the name of a file that can be used to extract the data. In traversingdirectories, <i>pax</i> shall detect infinite loops; that is, entering a previously visited directory that is an ancestor of thelast file visited. When it detects an infinite loop, <i>pax</i> shall write a diagnostic message to standard error and shallterminate.</p></blockquote><h4><a name="tag_04_100_04"></a>OPTIONS</h4><blockquote><p>The <i>pax</i> utility shall conform to the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/xbd_chap12.html#tag_12_02">Section 12.2, Utility Syntax Guidelines</a>, except that the order of presentation of the<b>-o</b>, <b>-p</b>, and <b>-s</b> options is significant.</p><p>The following options shall be supported:</p><dl compact><dt><b>-r</b></dt><dd>Read an archive file from standard input.</dd><dt><b>-w</b></dt><dd>Write files to the standard output in the specified archive format.</dd><dt><b>-a</b></dt><dd>Append files to the end of the archive. It is implementation-defined which devices on the system support appending. Additionalfile formats unspecified by this volume of IEEE&nbsp;Std&nbsp;1003.1-2001 may impose restrictions on appending.</dd><dt><b>-b&nbsp;</b> <i>blocksize</i></dt><dd>Block the output at a positive decimal integer number of bytes per write to the archive file. Devices and archive formats mayimpose restrictions on blocking. Blocking shall be automatically determined on input. Conforming applications shall not specify a<i>blocksize</i> value larger than 32256. Default blocking when creating archives depends on the archive format. (See the <b>-x</b>option below.)</dd><dt><b>-c</b></dt><dd>Match all file or archive members except those specified by the <i>pattern</i> or <i>file</i> operands.</dd><dt><b>-d</b></dt><dd>Cause files of type directory being copied or archived or archive members of type directory being extracted or listed to matchonly the file or archive member itself and not the file hierarchy rooted at the file.</dd><dt><b>-f&nbsp;</b> <i>archive</i></dt><dd>Specify the pathname of the input or output archive, overriding the default standard input (in <b>list</b> or <b>read</b>modes) or standard output ( <b>write</b> mode).</dd><dt><b>-H</b></dt><dd>If a symbolic link referencing a file of type directory is specified on the command line, <i>pax</i> shall archive the filehierarchy rooted in the file referenced by the link, using the name of the link as the root of the file hierarchy. Otherwise, if asymbolic link referencing a file of any other file type which <i>pax</i> can normally archive is specified on the command line,then <i>pax</i> shall archive the file referenced by the link, using the name of the link. The default behavior shall be to archivethe symbolic link itself.</dd><dt><b>-i</b></dt><dd>Interactively rename files or archive members. For each archive member matching a <i>pattern</i> operand or file matching a<i>file</i> operand, a prompt shall be written to the file <b>/dev/tty</b>. The prompt shall contain the name of the file orarchive member, but the format is otherwise unspecified. A line shall then be read from <b>/dev/tty</b>. If this line is blank, thefile or archive member shall be skipped. If this line consists of a single period, the file or archive member shall be processedwith no modification to its name. Otherwise, its name shall be replaced with the contents of the line. The <i>pax</i> utility shallimmediately exit with a non-zero exit status if end-of-file is encountered when reading a response or if <b>/dev/tty</b> cannot beopened for reading and writing. <p>The results of extracting a hard link to a file that has been renamed during extraction are unspecified.</p></dd><dt><b>-k</b></dt><dd>Prevent the overwriting of existing files.</dd><dt><b>-l</b></dt><dd>(The letter ell.) In <b>copy</b> mode, hard links shall be made between the source and destination file hierarchies wheneverpossible. If specified in conjunction with <b>-H</b> or <b>-L</b>, when a symbolic link is encountered, the hard link created inthe destination file hierarchy shall be to the file referenced by the symbolic link. If specified when neither <b>-H</b> nor<b>-L</b> is specified, when a symbolic link is encountered, the implementation shall create a hard link to the symbolic link inthe source file hierarchy or copy the symbolic link to the destination.</dd><dt><b>-L</b></dt><dd>If a symbolic link referencing a file of type directory is specified on the command line or encountered during the traversal ofa file hierarchy, <i>pax</i> shall archive the file hierarchy rooted in the file referenced by the link, using the name of the linkas the root of the file hierarchy. Otherwise, if a symbolic link referencing a file of any other file type which <i>pax</i> cannormally archive is specified on the command line or encountered during the traversal of a file hierarchy, <i>pax</i> shall archivethe file referenced by the link, using the name of the link. The default behavior shall be to archive the symbolic linkitself.</dd><dt><b>-n</b></dt><dd>Select the first archive member that matches each <i>pattern</i> operand. No more than one archive member shall be matched foreach pattern (although members of type directory shall still match the file hierarchy rooted at that file).</dd><dt><b>-o&nbsp;</b> <i>options</i></dt><dd>Provide information to the implementation to modify the algorithm for extracting or writing files. The value of <i>options</i>shall consist of one or more comma-separated keywords of the form: <pre><i>keyword</i><b>[[</b><tt>:</tt><b>]</b><tt>=</tt><i>value</i><b>][</b><tt>,</tt><i>keyword</i><b>[[</b><tt>:</tt><b>]</b><tt>=</tt><i>value</i><b>]</b><tt>, ...</tt><b>]</b></pre><p>Some keywords apply only to certain file formats, as indicated with each description. Use of keywords that are inapplicable tothe file format being processed produces undefined results.</p><p>Keywords in the <i>options</i> argument shall be a string that would be a valid portable filename as described in the BaseDefinitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/xbd_chap03.html#tag_03_276">Section 3.276, PortableFilename Character Set</a>. <basefont size="2"></p><dl><dt><b>Note:</b></dt><dd>Keywords are not expected to be filenames, merely to follow the same character composition rules as portable filenames.</dd></dl><basefont size="3"> <p>Keywords can be preceded with white space. The <i>value</i> field shall consist of zero or more characters; within <i>value</i>,the application shall precede any literal comma with a backslash, which shall be ignored, but preserves the comma as part of<i>value</i>. A comma as the final character, or a comma followed solely by white space as the final characters, in <i>options</i>shall be ignored. Multiple <b>-o</b> options can be specified; if keywords given to these multiple <b>-o</b> options conflict, thekeywords and values appearing later in command line sequence shall take precedence and the earlier shall be silently ignored. Thefollowing keyword values of <i>options</i> shall be supported for the file formats as indicated:</p><dl compact><dt><b>delete</b>=<i>pattern</i></dt><dd><br>(Applicable only to the <b>-x</b> <b>pax</b> format.) When used in <b>write</b> or <b>copy</b> mode, <i>pax</i> shall omit fromextended header records that it produces any keywords matching the string pattern. When used in <b>read</b> or <b>list</b> mode,<i>pax</i> shall ignore any keywords matching the string pattern in the extended header records. In both cases, matching shall beperformed using the pattern matching notation described in <a href="xcu_chap02.html#tag_02_13_01"><i>Patterns Matching a SingleCharacter</i></a> and <a href="xcu_chap02.html#tag_02_13_02"><i>Patterns Matching Multiple Characters</i></a> . For example: <pre><tt>-o</tt> <b>delete</b><tt>=</tt><i>security</i><tt>.*</tt></pre><p>would suppress security-related information. See <a href="#tag_04_100_13_03">pax Extended Header</a> for extended header recordkeyword usage.</p></dd><dt><b>exthdr.name</b>=<i>string</i></dt>

⌨️ 快捷键说明

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