<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>

<sect1 id="ch-system-coreutils" role="wrap">
  <?dbhtml filename="coreutils.html"?>

  <sect1info condition="script">
    <productname>coreutils</productname>
    <productnumber>&coreutils-version;</productnumber>
    <address>&coreutils-url;</address>
  </sect1info>

  <title>Coreutils-&coreutils-version;</title>

  <indexterm zone="ch-system-coreutils">
    <primary sortas="a-Coreutils">Coreutils</primary>
  </indexterm>

  <sect2 role="package">
    <title/>

    <para>Coreutils 软件包包含用于显示和设定系统基本属性的工具。</para>

    <segmentedlist>
      <segtitle>&buildtime;</segtitle>
      <segtitle>&diskspace;</segtitle>

      <seglistitem>
        <seg>&coreutils-ch6-sbu;</seg>
        <seg>&coreutils-ch6-du;</seg>
      </seglistitem>
    </segmentedlist>

  </sect2>

  <sect2 role="installation">
    <title>安装 Coreutils</title>

    <!--para>POSIX requires that programs from Coreutils recognize character
    boundaries correctly even in multibyte locales. The following patch fixes
    this non-compliance and other internationalization-related bugs.</para-->
    <para>POSIX 要求 Coreutils 中的程序即使在多字节 locale
    中也能正确识别字符边界。下面应用一个补丁，
    以解决 Coreutils 不满足这项 POSIX 要求的问题，
    并修复其他一些国际化相关的 bug：</para>

<screen><userinput remap="pre">patch -Np1 -i ../&coreutils-i18n-patch;</userinput></screen>

    <note>
      <!--para>In the past, many bugs were found in this patch. When reporting new
      bugs to Coreutils maintainers, please check first if they are reproducible
      without this patch.</para-->
      <para>在之前，这个补丁中找出了许多 bug。在向 Coreutils 维护者报告新
      	  bug 前，请检查它们在不使用该补丁的情况下是否还会重现。</para>
    </note>

   <!-- this has been fixed in upstream gnulib, when a new version of
   coreutils is released, please check #4055 to see if the change has been
   picked up in this package -->
   <para>阻止一个在某些机器上会无限循环的测试：</para>

<screen><userinput remap="pre">sed -i '/test.lock/s/^/#/' gnulib-tests/gnulib.mk</userinput></screen>

    <para>现在准备编译 Coreutils：</para>

<screen><userinput remap="configure">autoreconf -fiv
FORCE_UNSAFE_CONFIGURE=1 ./configure \
            --prefix=/usr            \
            --enable-no-install-program=kill,uptime</userinput></screen>

    <variablelist>
      <title>配置选项的含义：</title>

      <varlistentry>
        <term><command>autoreconf</command></term>
        <listitem>
          <para>该命令重新生成配置文件，使之与 automake 的最新版本一致。
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><envar>FORCE_UNSAFE_CONFIGURE=1</envar></term>
        <listitem>
          <para>该环境变量允许以 root 用户身份构建该软件包。
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><parameter>--enable-no-install-program=kill,uptime</parameter></term>
        <listitem>
          <para>这个开关的目的是防止 Coreutils
          	  安装那些被其他软件包安装的二进制程序。
          </para>
        </listitem>
      </varlistentry>
    </variablelist>

    <para>编译该软件包：</para>

<screen><userinput remap="make">FORCE_UNSAFE_CONFIGURE=1 make</userinput></screen>

    <para>如果不运行测试套件，
    	直接跳到 <quote>安装该软件包</quote> 。</para>

    <para>现在测试套件已经可以运行了。首先运行那些设计为由
    <systemitem class="username">root</systemitem> 用户运行的测试：</para>

<screen><userinput remap="test">make NON_ROOT_USERNAME=nobody check-root</userinput></screen>

    <para>之后我们要以
		<systemitem class="username">nobody</systemitem>
		用户身份运行其余测试。然而，某些测试要求测试用户属于至少一个组。
		为了不跳过这些测试，我们添加一个临时组，并使得 
		<systemitem class="username">nobody</systemitem>
		用户成为它的成员：
	</para>

<screen><userinput remap="test">echo "dummy:x:1000:nobody" &gt;&gt; /etc/group</userinput></screen>

    <para>修正访问权限，使得非 root 用户可以编译和运行测试：</para>

<screen><userinput remap="test">chown -Rv nobody . </userinput></screen>

    <para>执行以下命令，确保 <userinput>su</userinput> 环境的 PATH
		变量包含 /tools/bin 并运行测试：</para>

<screen><userinput remap="test">su nobody -s /bin/bash \
          -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen>

    <!--para>The test program test-getlogin is known to fail in a
    partially built system environment like the chroot environment here, but
    passes if run at the end of this chapter.  The test program tty.sh is
    also known to fail.</para-->
    <para>已知测试程序 test-getlogin 在部分构建的系统环境（如这里的
		chroot 环境）会失败，但是在本章的最后再运行即可通过。
		另外已知测试程序 tty.sh 可能会失败。</para>

    <para>删除临时组：</para>

<screen><userinput remap="test">sed -i '/dummy/d' /etc/group</userinput></screen>

    <para>安装该软件包：</para>

<screen><userinput remap="install">make install</userinput></screen>

    <para>将程序移动到 FHS 要求的位置：</para>

<screen><userinput remap="install">mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin
mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
mv -v /usr/bin/chroot /usr/sbin
mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8
sed -i s/\"1\"/\"8\"/1 /usr/share/man/man8/chroot.8</userinput></screen>

    <para revision="sysv">LFS-Bootscripts 软件包中的某些启动脚本依赖于
    <command>head</command>、<command>sleep</command> 和
	<command>nice</command>。由于
	<filename class="directory">/usr</filename> 在引导早期阶段可能不可用，
    需要把它们移动到根分区： </para>

    <para revision="systemd">BLFS 和 BLFS 之外的一些软件包预期下列程序位于
		<filename class="directory">/bin</filename> 中，
		因此必须保证它们被放置在那里：</para>

<screen><userinput remap="install">mv -v /usr/bin/{head,sleep,nice} /bin</userinput></screen>

  </sect2>

  <sect2 id="contents-coreutils" role="content">
    <title>Coreutils 的内容</title>

    <segmentedlist>
      <segtitle>安装的程序</segtitle>
      <segtitle>安装的库</segtitle>
      <segtitle>安装的目录</segtitle>

      <seglistitem>
        <seg>[, base32, base64, basename, cat, chcon, chgrp, chmod, chown,
        chroot, cksum, comm, cp, csplit, cut, date, dd, df, dir, dircolors,
        dirname, du, echo, env, expand, expr, factor, false, fmt, fold, groups,
        head, hostid, id, install, join, link, ln, logname, ls, md5sum, mkdir,
        mkfifo, mknod, mktemp, mv, nice, nl, nohup, nproc, numfmt, od, paste,
        pathchk, pinky, pr, printenv, printf, ptx, pwd, readlink, realpath, rm,
        rmdir, runcon, seq, sha1sum, sha224sum, sha256sum, sha384sum,
        sha512sum, shred, shuf, sleep, sort, split, stat, stdbuf, stty, sum,
        sync, tac, tail, tee, test, timeout, touch, tr, true, truncate, tsort,
        tty, uname, unexpand, uniq, unlink, users, vdir, wc, who, whoami, 以及
        yes</seg>
        <seg>libstdbuf.so</seg>
        <seg>/usr/libexec/coreutils</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">简要描述</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="base32">
        <term><command>base32</command></term>
        <listitem>
          <para>根据 base32 标准（RFC 4648）编码和解码数据</para>
          <indexterm zone="ch-system-coreutils base64">
            <primary sortas="b-base64">base64</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="base64">
        <term><command>base64</command></term>
        <listitem>
          <para>根据 base64 标准（RFC 4648）编码和解码数据</para>
          <indexterm zone="ch-system-coreutils base64">
            <primary sortas="b-base64">base64</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="basename">
        <term><command>basename</command></term>
        <listitem>
          <para>从文件名移除所有路径和一个给定后缀</para>
          <indexterm zone="ch-system-coreutils basename">
            <primary sortas="b-basename">basename</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="cat">
        <term><command>cat</command></term>
        <listitem>
          <para>将文件合并到标准输出</para>
          <indexterm zone="ch-system-coreutils cat">
            <primary sortas="b-cat">cat</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="chcon">
        <term><command>chcon</command></term>
        <listitem>
          <para>修改文件和目录的 SELinux 安全上下文</para>
          <indexterm zone="ch-system-coreutils chcon">
            <primary sortas="b-chcon">chcon</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="chgrp">
        <term><command>chgrp</command></term>
        <listitem>
          <para>修改文件和目录所属的组</para>
          <indexterm zone="ch-system-coreutils chgrp">
            <primary sortas="b-chgrp">chgrp</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="chmod">
        <term><command>chmod</command></term>
        <listitem>
          <para>修改给定文件的访问权限为指定模式；
          模式可以是所需修改的符号表示，或新权限的八进制码</para>
          <indexterm zone="ch-system-coreutils chmod">
            <primary sortas="b-chmod">chmod</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="chown">
        <term><command>chown</command></term>
        <listitem>
          <para>修改拥有文件的用户或组</para>
          <indexterm zone="ch-system-coreutils chown">
            <primary sortas="b-chown">chown</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="chroot">
        <term><command>chroot</command></term>
        <listitem>
          <para>将给定目录作为
          <filename class="directory">/</filename> 目录，运行命令</para>
          <indexterm zone="ch-system-coreutils chroot">
            <primary sortas="b-chroot">chroot</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="cksum">
        <term><command>cksum</command></term>
        <listitem>
          <para>输出每个给定文件的循环冗余检查（CRC）
          	  校验和及字节数</para>
          <indexterm zone="ch-system-coreutils cksum">
            <primary sortas="b-cksum">cksum</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="comm">
        <term><command>comm</command></term>
        <listitem>
          <para>比较两个排好序的文件，
          	  将两个文件特有的部分和它们共有的部分显示为三列</para>
          <indexterm zone="ch-system-coreutils comm">
            <primary sortas="b-comm">comm</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="cp">
        <term><command>cp</command></term>
        <listitem>
          <para>复制文件</para>
          <indexterm zone="ch-system-coreutils cp">
            <primary sortas="b-cp">cp</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="csplit">
        <term><command>csplit</command></term>
        <listitem>
          <para>将给定文件分割为若干新文件，根据给定模式或行号进行分割，
          并输出每个新文件的字节数</para>
          <indexterm zone="ch-system-coreutils csplit">
            <primary sortas="b-csplit">csplit</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="cut">
        <term><command>cut</command></term>
        <listitem>
          <para>根据给定的域或位置，打印输入的分节和选定部分</para>
          <indexterm zone="ch-system-coreutils cut">
            <primary sortas="b-cut">cut</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="date">
        <term><command>date</command></term>
        <listitem>
          <para>以给定格式显示当前时间，或设定系统时间</para>
          <indexterm zone="ch-system-coreutils date">
            <primary sortas="b-date">date</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="dd">
        <term><command>dd</command> </term>
        <listitem>
          <para>以给定块大小和个数复制文件，同时可以进行转换</para>
          <indexterm zone="ch-system-coreutils dd">
            <primary sortas="b-dd">dd</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="df">
        <term><command>df</command></term>
        <listitem>
          <para>报告每个已挂载文件系统（或包含给定文件的文件系统）
          	  的总大小和可用空间</para>
          <indexterm zone="ch-system-coreutils df">
            <primary sortas="b-df">df</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="dir">
        <term><command>dir</command></term>
        <listitem>
          <para>列出给定目录的内容 （和
          <command>ls</command> 命令相同）</para>
          <indexterm zone="ch-system-coreutils dir">
            <primary sortas="b-dir">dir</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="dircolors">
        <term><command>dircolors</command></term>
        <listitem>
          <para>输出用于设定 <envar>LS_COLOR</envar>
          环境变量的命令，以修改
          <command>ls</command> 的配色方案</para>
          <indexterm zone="ch-system-coreutils dircolors">
            <primary sortas="b-dircolors">dircolors</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="dirname">
        <term><command>dirname</command></term>
        <listitem>
          <para>从文件名中删掉非目录的后缀</para>
          <indexterm zone="ch-system-coreutils dirname">
            <primary sortas="b-dirname">dirname</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="du">
        <term><command>du</command></term>
        <listitem>
          <para>报告当前目录使用的磁盘空间，
          给出当前目录下所有子目录和文件占用的空间</para>
          <indexterm zone="ch-system-coreutils du">
            <primary sortas="b-du">du</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="echo">
        <term><command>echo</command></term>
        <listitem>
          <para>显示给定字符串</para>
          <indexterm zone="ch-system-coreutils echo">
            <primary sortas="b-echo">echo</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="env">
        <term><command>env</command></term>
        <listitem>
          <para>在修改的环境中运行命令</para>
          <indexterm zone="ch-system-coreutils env">
            <primary sortas="b-env">env</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="expand">
        <term><command>expand</command></term>
        <listitem>
          <para>将制表符转换成空格</para>
          <indexterm zone="ch-system-coreutils expand">
            <primary sortas="b-expand">expand</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="expr">
        <term><command>expr</command></term>
        <listitem>
          <para>计算表达式</para>
          <indexterm zone="ch-system-coreutils expr">
            <primary sortas="b-expr">expr</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="factor">
        <term><command>factor</command></term>
        <listitem>
          <para>打印所有给定整数的质因数</para>
          <indexterm zone="ch-system-coreutils factor">
            <primary sortas="b-factor">factor</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="false">
        <term><command>false</command></term>
        <listitem>
          <para>什么也不做；总是以失败状态码退出；</para>
          <indexterm zone="ch-system-coreutils false">
            <primary sortas="b-false">false</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="fmt">
        <term><command>fmt</command></term>
        <listitem>
          <para>重新格式化给定文件的段落</para>
          <indexterm zone="ch-system-coreutils fmt">
            <primary sortas="b-fmt">fmt</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="fold">
        <term><command>fold</command></term>
        <listitem>
          <para>折叠给定文件中的行</para>
          <indexterm zone="ch-system-coreutils fold">
            <primary sortas="b-fold">fold</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="groups">
        <term><command>groups</command></term>
        <listitem>
          <para>报告用户所属的组</para>
          <indexterm zone="ch-system-coreutils groups">
            <primary sortas="b-groups">groups</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="head">
        <term><command>head</command></term>
        <listitem>
          <para>打印文件的前 10 （或给定行数）行</para>
          <indexterm zone="ch-system-coreutils head">
            <primary sortas="b-head">head</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="hostid">
        <term><command>hostid</command></term>
        <listitem>
          <para>以十六进制格式打印主机数字标识符</para>
          <indexterm zone="ch-system-coreutils hostid">
            <primary sortas="b-hostid">hostid</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="id">
        <term><command>id</command></term>
        <listitem>
          <para>报告当前用户或给定用户的有效用户 ID、组 ID 和所属的组
          </para>
          <indexterm zone="ch-system-coreutils id">
            <primary sortas="b-id">id</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="install">
        <term><command>install</command> </term>
        <listitem>
          <para>复制文件并设定它们的访问权限，以及（如果可能）
          	  它们的所有者和属组</para>
          <indexterm zone="ch-system-coreutils install">
            <primary sortas="b-install">install</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="join">
        <term><command>join</command></term>
        <listitem>
          <para>将两个文件中拥有相同域的行合并</para>
          <indexterm zone="ch-system-coreutils join">
            <primary sortas="b-join">join</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="link">
        <term><command>link</command></term>
        <listitem>
          <para>以给定文件名创建硬链接</para>
          <indexterm zone="ch-system-coreutils link">
            <primary sortas="b-link">link</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="ln">
        <term><command>ln</command></term>
        <listitem>
          <para>在文件之间创建硬链接或软（符号）链接</para>
          <indexterm zone="ch-system-coreutils ln">
            <primary sortas="b-ln">ln</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="logname">
        <term><command>logname</command></term>
        <listitem>
          <para>报告当前用户登录名</para>
          <indexterm zone="ch-system-coreutils logname">
            <primary sortas="b-logname">logname</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="ls">
        <term><command>ls</command></term>
        <listitem>
          <para>列出给定目录内容</para>
          <indexterm zone="ch-system-coreutils ls">
            <primary sortas="b-ls">ls</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="md5sum">
        <term><command>md5sum</command></term>
        <listitem>
          <para>报告或检查消息摘要 5 （MD5）校验和</para>
          <indexterm zone="ch-system-coreutils md5sum">
            <primary sortas="b-md5sum">md5sum</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="mkdir">
        <term><command>mkdir</command></term>
        <listitem>
          <para>以给定名称创建目录</para>
          <indexterm zone="ch-system-coreutils mkdir">
            <primary sortas="b-mkdir">mkdir</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="mkfifo">
        <term><command>mkfifo</command></term>
        <listitem>
          <para>以给定名称创建先进先出表（FIFO），
			  在 UNIX 惯用语中又称为 <quote>命名管道</quote></para>
          <indexterm zone="ch-system-coreutils mkfifo">
            <primary sortas="b-mkfifo">mkfifo</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="mknod">
        <term><command>mknod</command></term>
        <listitem>
          <para>以给定名称创建设备节点；设备节点可能是字符特殊文件、
          块特殊文件或 FIFO</para>
          <indexterm zone="ch-system-coreutils mknod">
            <primary sortas="b-mknod">mknod</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="mktemp">
        <term><command>mktemp</command></term>
        <listitem>
          <para>安全地创建临时文件，常用在脚本中</para>
        <indexterm zone="ch-system-coreutils mktemp">
          <primary sortas="b-mktemp">mktemp</primary>
        </indexterm>
       </listitem>
     </varlistentry>

      <varlistentry id="mv">
        <term><command>mv</command></term>
        <listitem>
          <para>移动或重命名文件或目录</para>
          <indexterm zone="ch-system-coreutils mv">
            <primary sortas="b-mv">mv</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="nice">
        <term><command>nice</command></term>
        <listitem>
          <para>以修改的调度优先级运行程序</para>
          <indexterm zone="ch-system-coreutils nice">
            <primary sortas="b-nice">nice</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="nl">
        <term><command>nl</command></term>
        <listitem>
          <para>标出给定文件的行</para>
          <indexterm zone="ch-system-coreutils nl">
            <primary sortas="b-nl">nl</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="nohup">
        <term><command>nohup</command></term>
        <listitem>
          <para>以免疫挂机信号的方式执行命令，同时将输出重定向到日志文件
          </para>
          <indexterm zone="ch-system-coreutils nohup">
            <primary sortas="b-nohup">nohup</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="nproc">
        <term><command>nproc</command></term>
        <listitem>
          <para>打印进程可用的处理单元数目</para>
          <indexterm zone="ch-system-coreutils nproc">
            <primary sortas="b-nproc">nproc</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="numfmt">
        <term><command>numfmt</command></term>
        <listitem>
          <para>在数字和人类可读字符串之间互相转换</para>
          <indexterm zone="ch-system-coreutils numfmt">
            <primary sortas="b-numfmt">numfmt</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="od">
        <term><command>od</command></term>
        <listitem>
          <para>以八进制或其他格式转储文件</para>
          <indexterm zone="ch-system-coreutils od">
            <primary sortas="b-od">od</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="paste">
        <term><command>paste</command></term>
        <listitem>
          <para>合并给定文件，将它们的对应行连接起来，以制表符分割</para>
          <indexterm zone="ch-system-coreutils paste">
            <primary sortas="b-paste">paste</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pathchk">
        <term><command>pathchk</command></term>
        <listitem>
          <para>检查文件名的有效性和可移植性</para>
          <indexterm zone="ch-system-coreutils pathchk">
            <primary sortas="b-pathchk">pathchk</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pinky">
        <term><command>pinky</command></term>
        <listitem>
          <para>是轻量级 finger 客户端，报告给定用户的一些信息</para>
          <indexterm zone="ch-system-coreutils pinky">
            <primary sortas="b-pinky">pinky</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pr">
        <term><command>pr</command></term>
        <listitem>
          <para>对文件进行分页和分栏以便打印</para>
          <indexterm zone="ch-system-coreutils pr">
            <primary sortas="b-pr">pr</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="printenv">
        <term><command>printenv</command></term>
        <listitem>
          <para>打印环境变量</para>
          <indexterm zone="ch-system-coreutils printenv">
            <primary sortas="b-printenv">printenv</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="printf">
        <term><command>printf</command></term>
        <listitem>
          <para>以给定格式打印给定参数，很像 C printf 函数</para>
          <indexterm zone="ch-system-coreutils printf">
            <primary sortas="b-printf">printf</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="ptx">
        <term><command>ptx</command></term>
        <listitem>
          <para>用文中的每个关键字，根据给定文件内容生成重排索引</para>
          <indexterm zone="ch-system-coreutils ptx">
            <primary sortas="b-ptx">ptx</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pwd">
        <term><command>pwd</command></term>
        <listitem>
          <para>报告当前工作目录名</para>
          <indexterm zone="ch-system-coreutils pwd">
            <primary sortas="b-pwd">pwd</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="readlink">
        <term><command>readlink</command></term>
        <listitem>
          <para>报告给定符号链接的值</para>
          <indexterm zone="ch-system-coreutils readlink">
            <primary sortas="b-readlink">readlink</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="realpath">
        <term><command>realpath</command></term>
        <listitem>
          <para>打印解析过的目录</para>
          <indexterm zone="ch-system-coreutils realpath">
            <primary sortas="b-realpath">realpath</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="rm">
        <term><command>rm</command></term>
        <listitem>
          <para>删除文件或目录</para>
          <indexterm zone="ch-system-coreutils rm">
            <primary sortas="b-rm">rm</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="rmdir">
        <term><command>rmdir</command></term>
        <listitem>
          <para>如果目录是空的，删除它们</para>
          <indexterm zone="ch-system-coreutils rmdir">
            <primary sortas="b-rmdir">rmdir</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="runcon">
        <term><command>runcon</command></term>
        <listitem>
          <para>以给定 SELinux 安全上下文运行命令</para>
          <indexterm zone="ch-system-coreutils runcon">
            <primary sortas="b-runcon">runcon</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="seq">
        <term><command>seq</command></term>
        <listitem>
          <para>以给定的范围和增量打印等差数列</para>
          <indexterm zone="ch-system-coreutils seq">
            <primary sortas="b-seq">seq</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="sha1sum">
        <term><command>sha1sum</command></term>
        <listitem>
          <para>打印或检查 160 位安全散列算法 1 （SHA1）校验和</para>
          <indexterm zone="ch-system-coreutils sha1sum">
            <primary sortas="b-sha1sum">sha1sum</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="sha224sum">
        <term><command>sha224sum</command></term>
        <listitem>
          <para>打印或检查 224 位安全散列算法校验和</para>
          <indexterm zone="ch-system-coreutils sha224sum">
            <primary sortas="b-sha224sum">sha224sum</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="sha256sum">
        <term><command>sha256sum</command></term>
        <listitem>
          <para>打印或检查 256 位安全散列算法校验和</para>
          <indexterm zone="ch-system-coreutils sha256sum">
            <primary sortas="b-sha256sum">sha256sum</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="sha384sum">
        <term><command>sha384sum</command></term>
        <listitem>
          <para>打印或检查 384 位安全散列算法校验和</para>
          <indexterm zone="ch-system-coreutils sha384sum">
            <primary sortas="b-sha384sum">sha384sum</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="sha512sum">
        <term><command>sha512sum</command></term>
        <listitem>
          <para>打印或检查 512 位安全散列算法校验和</para>
          <indexterm zone="ch-system-coreutils sha512sum">
            <primary sortas="b-sha512sum">sha512sum</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="shred">
        <term><command>shred</command></term>
        <listitem>
          <para>将给定文件多次用复杂模式覆盖，增加恢复数据的难度</para>
          <indexterm zone="ch-system-coreutils shred">
            <primary sortas="b-shred">shred</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="shuf">
        <term><command>shuf</command></term>
        <listitem>
          <para>打乱文件中的行</para>
          <indexterm zone="ch-system-coreutils shuf">
            <primary sortas="b-shuf">shuf</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="sleep">
        <term><command>sleep</command></term>
        <listitem>
          <para>等待给定时间</para>
          <indexterm zone="ch-system-coreutils sleep">
            <primary sortas="b-sleep">sleep</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="sort">
        <term><command>sort</command></term>
        <listitem>
          <para>对给定文件的行进行排序</para>
          <indexterm zone="ch-system-coreutils sort">
            <primary sortas="b-sort">sort</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="split">
        <term><command>split</command></term>
        <listitem>
          <para>根据大小或行数，将指定文件分割成若干部分</para>
          <indexterm zone="ch-system-coreutils split">
            <primary sortas="b-split">split</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="stat">
        <term><command>stat</command></term>
        <listitem>
          <para>显示文件或文件系统状态</para>
          <indexterm zone="ch-system-coreutils stat">
            <primary sortas="b-stat">stat</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="stdbuf">
        <term><command>stdbuf</command></term>
        <listitem>
          <para>以修改的标准流缓冲操作运行命令</para>
          <indexterm zone="ch-system-coreutils stdbuf">
            <primary sortas="b-stdbuf">stdbuf</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="stty">
        <term><command>stty</command></term>
        <listitem>
          <para>设置或报告终端行设定</para>
          <indexterm zone="ch-system-coreutils stty">
            <primary sortas="b-stty">stty</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="sum">
        <term><command>sum</command></term>
        <listitem>
          <para>打印每个指定文件的校验和及块个数</para>
          <indexterm zone="ch-system-coreutils sum">
            <primary sortas="b-sum">sum</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="sync">
        <term><command>sync</command></term>
        <listitem>
          <para>刷新文件系统缓冲；它将修改过的块强制写入磁盘，
          并更新超级块</para>
          <indexterm zone="ch-system-coreutils sync">
            <primary sortas="b-sync">sync</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="tac">
        <term><command>tac</command></term>
        <listitem>
          <para>逆序连接给定文件</para>
          <indexterm zone="ch-system-coreutils tac">
            <primary sortas="b-tac">tac</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="tail">
        <term><command>tail</command></term>
        <listitem>
          <para>输出给定文件的最后 10 （或指定行数）行</para>
          <indexterm zone="ch-system-coreutils tail">
            <primary sortas="b-tail">tail</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="tee">
        <term><command>tee</command></term>
        <listitem>
          <para>读取标准输入，并将内容同时写入标准输出和给定文件</para>
          <indexterm zone="ch-system-coreutils tee">
            <primary sortas="b-tee">tee</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="test">
        <term><command>test</command></term>
        <listitem>
          <para>比较两个值，或检查文件类型</para>
          <indexterm zone="ch-system-coreutils test">
            <primary sortas="b-test">test</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="timeout">
        <term><command>timeout</command></term>
        <listitem>
          <para>在限定时间内运行命令</para>
          <indexterm zone="ch-system-coreutils timeout">
            <primary sortas="b-timeout">timeout</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="touch">
        <term><command>touch</command></term>
        <listitem>
          <para>修改文件时间戳，将每个给定文件的访问和修改时间设为当前时间;
          以零长度创建当前不存在的文件</para>
          <indexterm zone="ch-system-coreutils touch">
            <primary sortas="b-touch">touch</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="tr">
        <term><command>tr</command></term>
        <listitem>
          <para>从标准输入变换、压缩或删除给定字符</para>
          <indexterm zone="ch-system-coreutils tr">
            <primary sortas="b-tr">tr</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="true">
        <term><command>true</command></term>
        <listitem>
          <para>什么也不做；总是以成功状态码退出</para>
          <indexterm zone="ch-system-coreutils true">
            <primary sortas="b-true">true</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="truncate">
        <term><command>truncate</command></term>
        <listitem>
          <para>将文件截断或扩展到指定大小</para>
          <indexterm zone="ch-system-coreutils truncate">
            <primary sortas="b-truncate">truncate</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="tsort">
        <term><command>tsort</command></term>
        <listitem>
          <para>进行拓扑排序；
          	  根据给定文件的部分顺序信息输出完整的排序列表</para>
          <indexterm zone="ch-system-coreutils tsort">
            <primary sortas="b-tsort">tsort</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="tty">
        <term><command>tty</command></term>
        <listitem>
          <para>报告标准输入的终端文件名</para>
          <indexterm zone="ch-system-coreutils tty">
            <primary sortas="b-tty">tty</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="uname">
        <term><command>uname</command></term>
        <listitem>
          <para>报告系统信息</para>
          <indexterm zone="ch-system-coreutils uname">
            <primary sortas="b-uname">uname</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="unexpand">
        <term><command>unexpand</command></term>
        <listitem>
          <para>将空格转换成制表符</para>
          <indexterm zone="ch-system-coreutils unexpand">
            <primary sortas="b-unexpand">unexpand</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="uniq">
        <term><command>uniq</command></term>
        <listitem>
          <para>在连续的相同行中只保留一行，删除其他所有行</para>
          <indexterm zone="ch-system-coreutils uniq">
            <primary sortas="b-uniq">uniq</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="unlink">
        <term><command>unlink</command></term>
        <listitem>
          <para>删除给定文件</para>
          <indexterm zone="ch-system-coreutils unlink">
            <primary sortas="b-unlink">unlink</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="users">
        <term><command>users</command></term>
        <listitem>
          <para>报告当前登录系统的用户名</para>
          <indexterm zone="ch-system-coreutils users">
            <primary sortas="b-users">users</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="vdir">
        <term><command>vdir</command></term>
        <listitem>
          <para>和 <command>ls -l</command> 相同</para>
          <indexterm zone="ch-system-coreutils vdir">
            <primary sortas="b-vdir">vdir</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="wc">
        <term><command>wc</command></term>
        <listitem>
          <para>报告给定文件的行数、单词数和字节数</para>
          <indexterm zone="ch-system-coreutils wc">
            <primary sortas="b-wc">wc</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="who">
        <term><command>who</command></term>
        <listitem>
          <para>报告当前登录的用户</para>
          <indexterm zone="ch-system-coreutils who">
            <primary sortas="b-who">who</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="whoami">
        <term><command>whoami</command></term>
        <listitem>
          <para>报告与当前有效用户 ID 相关的用户名</para>
          <indexterm zone="ch-system-coreutils whoami">
            <primary sortas="b-whoami">whoami</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="yes">
        <term><command>yes</command></term>
        <listitem>
          <para>不停输出 <quote>y</quote> 或给定字符串，直到被杀死</para>
          <indexterm zone="ch-system-coreutils yes">
            <primary sortas="b-yes">yes</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libstdbuf">
        <term><filename class="libraryfile">libstdbuf</filename></term>
        <listitem>
          <para><command>stdbuf</command> 使用的库</para>
          <indexterm zone="ch-system-coreutils libstdbuf">
            <primary sortas="c-libstdbuf">libstdbuf</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
