coreutils.xml 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-system-coreutils" role="wrap">
  8. <?dbhtml filename="coreutils.html"?>
  9. <sect1info condition="script">
  10. <productname>coreutils</productname>
  11. <productnumber>&coreutils-version;</productnumber>
  12. <address>&coreutils-url;</address>
  13. </sect1info>
  14. <title>Coreutils-&coreutils-version;</title>
  15. <indexterm zone="ch-system-coreutils">
  16. <primary sortas="a-Coreutils">Coreutils</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>Coreutils 软件包包含用于显示和设定系统基本属性的工具。</para>
  21. <segmentedlist>
  22. <segtitle>&buildtime;</segtitle>
  23. <segtitle>&diskspace;</segtitle>
  24. <seglistitem>
  25. <seg>&coreutils-ch6-sbu;</seg>
  26. <seg>&coreutils-ch6-du;</seg>
  27. </seglistitem>
  28. </segmentedlist>
  29. </sect2>
  30. <sect2 role="installation">
  31. <title>安装 Coreutils</title>
  32. <!--para>POSIX requires that programs from Coreutils recognize character
  33. boundaries correctly even in multibyte locales. The following patch fixes
  34. this non-compliance and other internationalization-related bugs.</para-->
  35. <para>POSIX 要求 Coreutils 中的程序即使在多字节 locale
  36. 中也能正确识别字符边界。下面应用一个补丁,
  37. 以解决 Coreutils 不满足这项 POSIX 要求的问题,
  38. 并修复其他一些国际化相关的 bug:</para>
  39. <screen><userinput remap="pre">patch -Np1 -i ../&coreutils-i18n-patch;</userinput></screen>
  40. <note>
  41. <!--para>In the past, many bugs were found in this patch. When reporting new
  42. bugs to Coreutils maintainers, please check first if they are reproducible
  43. without this patch.</para-->
  44. <para>在之前,这个补丁中找出了许多 bug。在向 Coreutils 维护者报告新
  45. bug 前,请检查它们在不使用该补丁的情况下是否还会重现。</para>
  46. </note>
  47. <!-- this has been fixed in upstream gnulib, when a new version of
  48. coreutils is released, please check #4055 to see if the change has been
  49. picked up in this package -->
  50. <para>阻止一个在某些机器上会无限循环的测试:</para>
  51. <screen><userinput remap="pre">sed -i '/test.lock/s/^/#/' gnulib-tests/gnulib.mk</userinput></screen>
  52. <para>现在准备编译 Coreutils:</para>
  53. <screen><userinput remap="configure">autoreconf -fiv
  54. FORCE_UNSAFE_CONFIGURE=1 ./configure \
  55. --prefix=/usr \
  56. --enable-no-install-program=kill,uptime</userinput></screen>
  57. <variablelist>
  58. <title>配置选项的含义:</title>
  59. <varlistentry>
  60. <term><command>autoreconf</command></term>
  61. <listitem>
  62. <para>该命令重新生成配置文件,使之与 automake 的最新版本一致。
  63. </para>
  64. </listitem>
  65. </varlistentry>
  66. <varlistentry>
  67. <term><envar>FORCE_UNSAFE_CONFIGURE=1</envar></term>
  68. <listitem>
  69. <para>该环境变量允许以 root 用户身份构建该软件包。
  70. </para>
  71. </listitem>
  72. </varlistentry>
  73. <varlistentry>
  74. <term><parameter>--enable-no-install-program=kill,uptime</parameter></term>
  75. <listitem>
  76. <para>这个开关的目的是防止 Coreutils
  77. 安装那些被其他软件包安装的二进制程序。
  78. </para>
  79. </listitem>
  80. </varlistentry>
  81. </variablelist>
  82. <para>编译该软件包:</para>
  83. <screen><userinput remap="make">FORCE_UNSAFE_CONFIGURE=1 make</userinput></screen>
  84. <para>如果不运行测试套件,
  85. 直接跳到 <quote>安装该软件包</quote> 。</para>
  86. <para>现在测试套件已经可以运行了。首先运行那些设计为由
  87. <systemitem class="username">root</systemitem> 用户运行的测试:</para>
  88. <screen><userinput remap="test">make NON_ROOT_USERNAME=nobody check-root</userinput></screen>
  89. <para>之后我们要以
  90. <systemitem class="username">nobody</systemitem>
  91. 用户身份运行其余测试。然而,某些测试要求测试用户属于至少一个组。
  92. 为了不跳过这些测试,我们添加一个临时组,并使得
  93. <systemitem class="username">nobody</systemitem>
  94. 用户成为它的成员:
  95. </para>
  96. <screen><userinput remap="test">echo "dummy:x:1000:nobody" &gt;&gt; /etc/group</userinput></screen>
  97. <para>修正访问权限,使得非 root 用户可以编译和运行测试:</para>
  98. <screen><userinput remap="test">chown -Rv nobody . </userinput></screen>
  99. <para>执行以下命令,确保 <userinput>su</userinput> 环境的 PATH
  100. 变量包含 /tools/bin 并运行测试:</para>
  101. <screen><userinput remap="test">su nobody -s /bin/bash \
  102. -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen>
  103. <!--para>The test program test-getlogin is known to fail in a
  104. partially built system environment like the chroot environment here, but
  105. passes if run at the end of this chapter. The test program tty.sh is
  106. also known to fail.</para-->
  107. <para>已知测试程序 test-getlogin 在部分构建的系统环境(如这里的
  108. chroot 环境)会失败,但是在本章的最后再运行即可通过。
  109. 另外已知测试程序 tty.sh 可能会失败。</para>
  110. <para>删除临时组:</para>
  111. <screen><userinput remap="test">sed -i '/dummy/d' /etc/group</userinput></screen>
  112. <para>安装该软件包:</para>
  113. <screen><userinput remap="install">make install</userinput></screen>
  114. <para>将程序移动到 FHS 要求的位置:</para>
  115. <screen><userinput remap="install">mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
  116. mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin
  117. mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
  118. mv -v /usr/bin/chroot /usr/sbin
  119. mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8
  120. sed -i s/\"1\"/\"8\"/1 /usr/share/man/man8/chroot.8</userinput></screen>
  121. <para revision="sysv">LFS-Bootscripts 软件包中的某些启动脚本依赖于
  122. <command>head</command>、<command>sleep</command> 和
  123. <command>nice</command>。由于
  124. <filename class="directory">/usr</filename> 在引导早期阶段可能不可用,
  125. 需要把它们移动到根分区: </para>
  126. <para revision="systemd">BLFS 和 BLFS 之外的一些软件包预期下列程序位于
  127. <filename class="directory">/bin</filename> 中,
  128. 因此必须保证它们被放置在那里:</para>
  129. <screen><userinput remap="install">mv -v /usr/bin/{head,sleep,nice} /bin</userinput></screen>
  130. </sect2>
  131. <sect2 id="contents-coreutils" role="content">
  132. <title>Coreutils 的内容</title>
  133. <segmentedlist>
  134. <segtitle>安装的程序</segtitle>
  135. <segtitle>安装的库</segtitle>
  136. <segtitle>安装的目录</segtitle>
  137. <seglistitem>
  138. <seg>[, base32, base64, basename, cat, chcon, chgrp, chmod, chown,
  139. chroot, cksum, comm, cp, csplit, cut, date, dd, df, dir, dircolors,
  140. dirname, du, echo, env, expand, expr, factor, false, fmt, fold, groups,
  141. head, hostid, id, install, join, link, ln, logname, ls, md5sum, mkdir,
  142. mkfifo, mknod, mktemp, mv, nice, nl, nohup, nproc, numfmt, od, paste,
  143. pathchk, pinky, pr, printenv, printf, ptx, pwd, readlink, realpath, rm,
  144. rmdir, runcon, seq, sha1sum, sha224sum, sha256sum, sha384sum,
  145. sha512sum, shred, shuf, sleep, sort, split, stat, stdbuf, stty, sum,
  146. sync, tac, tail, tee, test, timeout, touch, tr, true, truncate, tsort,
  147. tty, uname, unexpand, uniq, unlink, users, vdir, wc, who, whoami, 以及
  148. yes</seg>
  149. <seg>libstdbuf.so</seg>
  150. <seg>/usr/libexec/coreutils</seg>
  151. </seglistitem>
  152. </segmentedlist>
  153. <variablelist>
  154. <bridgehead renderas="sect3">简要描述</bridgehead>
  155. <?dbfo list-presentation="list"?>
  156. <?dbhtml list-presentation="table"?>
  157. <varlistentry id="base32">
  158. <term><command>base32</command></term>
  159. <listitem>
  160. <para>根据 base32 标准(RFC 4648)编码和解码数据</para>
  161. <indexterm zone="ch-system-coreutils base64">
  162. <primary sortas="b-base64">base64</primary>
  163. </indexterm>
  164. </listitem>
  165. </varlistentry>
  166. <varlistentry id="base64">
  167. <term><command>base64</command></term>
  168. <listitem>
  169. <para>根据 base64 标准(RFC 4648)编码和解码数据</para>
  170. <indexterm zone="ch-system-coreutils base64">
  171. <primary sortas="b-base64">base64</primary>
  172. </indexterm>
  173. </listitem>
  174. </varlistentry>
  175. <varlistentry id="basename">
  176. <term><command>basename</command></term>
  177. <listitem>
  178. <para>从文件名移除所有路径和一个给定后缀</para>
  179. <indexterm zone="ch-system-coreutils basename">
  180. <primary sortas="b-basename">basename</primary>
  181. </indexterm>
  182. </listitem>
  183. </varlistentry>
  184. <varlistentry id="cat">
  185. <term><command>cat</command></term>
  186. <listitem>
  187. <para>将文件合并到标准输出</para>
  188. <indexterm zone="ch-system-coreutils cat">
  189. <primary sortas="b-cat">cat</primary>
  190. </indexterm>
  191. </listitem>
  192. </varlistentry>
  193. <varlistentry id="chcon">
  194. <term><command>chcon</command></term>
  195. <listitem>
  196. <para>修改文件和目录的 SELinux 安全上下文</para>
  197. <indexterm zone="ch-system-coreutils chcon">
  198. <primary sortas="b-chcon">chcon</primary>
  199. </indexterm>
  200. </listitem>
  201. </varlistentry>
  202. <varlistentry id="chgrp">
  203. <term><command>chgrp</command></term>
  204. <listitem>
  205. <para>修改文件和目录所属的组</para>
  206. <indexterm zone="ch-system-coreutils chgrp">
  207. <primary sortas="b-chgrp">chgrp</primary>
  208. </indexterm>
  209. </listitem>
  210. </varlistentry>
  211. <varlistentry id="chmod">
  212. <term><command>chmod</command></term>
  213. <listitem>
  214. <para>修改给定文件的访问权限为指定模式;
  215. 模式可以是所需修改的符号表示,或新权限的八进制码</para>
  216. <indexterm zone="ch-system-coreutils chmod">
  217. <primary sortas="b-chmod">chmod</primary>
  218. </indexterm>
  219. </listitem>
  220. </varlistentry>
  221. <varlistentry id="chown">
  222. <term><command>chown</command></term>
  223. <listitem>
  224. <para>修改拥有文件的用户或组</para>
  225. <indexterm zone="ch-system-coreutils chown">
  226. <primary sortas="b-chown">chown</primary>
  227. </indexterm>
  228. </listitem>
  229. </varlistentry>
  230. <varlistentry id="chroot">
  231. <term><command>chroot</command></term>
  232. <listitem>
  233. <para>将给定目录作为
  234. <filename class="directory">/</filename> 目录,运行命令</para>
  235. <indexterm zone="ch-system-coreutils chroot">
  236. <primary sortas="b-chroot">chroot</primary>
  237. </indexterm>
  238. </listitem>
  239. </varlistentry>
  240. <varlistentry id="cksum">
  241. <term><command>cksum</command></term>
  242. <listitem>
  243. <para>输出每个给定文件的循环冗余检查(CRC)
  244. 校验和及字节数</para>
  245. <indexterm zone="ch-system-coreutils cksum">
  246. <primary sortas="b-cksum">cksum</primary>
  247. </indexterm>
  248. </listitem>
  249. </varlistentry>
  250. <varlistentry id="comm">
  251. <term><command>comm</command></term>
  252. <listitem>
  253. <para>比较两个排好序的文件,
  254. 将两个文件特有的部分和它们共有的部分显示为三列</para>
  255. <indexterm zone="ch-system-coreutils comm">
  256. <primary sortas="b-comm">comm</primary>
  257. </indexterm>
  258. </listitem>
  259. </varlistentry>
  260. <varlistentry id="cp">
  261. <term><command>cp</command></term>
  262. <listitem>
  263. <para>复制文件</para>
  264. <indexterm zone="ch-system-coreutils cp">
  265. <primary sortas="b-cp">cp</primary>
  266. </indexterm>
  267. </listitem>
  268. </varlistentry>
  269. <varlistentry id="csplit">
  270. <term><command>csplit</command></term>
  271. <listitem>
  272. <para>将给定文件分割为若干新文件,根据给定模式或行号进行分割,
  273. 并输出每个新文件的字节数</para>
  274. <indexterm zone="ch-system-coreutils csplit">
  275. <primary sortas="b-csplit">csplit</primary>
  276. </indexterm>
  277. </listitem>
  278. </varlistentry>
  279. <varlistentry id="cut">
  280. <term><command>cut</command></term>
  281. <listitem>
  282. <para>根据给定的域或位置,打印输入的分节和选定部分</para>
  283. <indexterm zone="ch-system-coreutils cut">
  284. <primary sortas="b-cut">cut</primary>
  285. </indexterm>
  286. </listitem>
  287. </varlistentry>
  288. <varlistentry id="date">
  289. <term><command>date</command></term>
  290. <listitem>
  291. <para>以给定格式显示当前时间,或设定系统时间</para>
  292. <indexterm zone="ch-system-coreutils date">
  293. <primary sortas="b-date">date</primary>
  294. </indexterm>
  295. </listitem>
  296. </varlistentry>
  297. <varlistentry id="dd">
  298. <term><command>dd</command> </term>
  299. <listitem>
  300. <para>以给定块大小和个数复制文件,同时可以进行转换</para>
  301. <indexterm zone="ch-system-coreutils dd">
  302. <primary sortas="b-dd">dd</primary>
  303. </indexterm>
  304. </listitem>
  305. </varlistentry>
  306. <varlistentry id="df">
  307. <term><command>df</command></term>
  308. <listitem>
  309. <para>报告每个已挂载文件系统(或包含给定文件的文件系统)
  310. 的总大小和可用空间</para>
  311. <indexterm zone="ch-system-coreutils df">
  312. <primary sortas="b-df">df</primary>
  313. </indexterm>
  314. </listitem>
  315. </varlistentry>
  316. <varlistentry id="dir">
  317. <term><command>dir</command></term>
  318. <listitem>
  319. <para>列出给定目录的内容 (和
  320. <command>ls</command> 命令相同)</para>
  321. <indexterm zone="ch-system-coreutils dir">
  322. <primary sortas="b-dir">dir</primary>
  323. </indexterm>
  324. </listitem>
  325. </varlistentry>
  326. <varlistentry id="dircolors">
  327. <term><command>dircolors</command></term>
  328. <listitem>
  329. <para>输出用于设定 <envar>LS_COLOR</envar>
  330. 环境变量的命令,以修改
  331. <command>ls</command> 的配色方案</para>
  332. <indexterm zone="ch-system-coreutils dircolors">
  333. <primary sortas="b-dircolors">dircolors</primary>
  334. </indexterm>
  335. </listitem>
  336. </varlistentry>
  337. <varlistentry id="dirname">
  338. <term><command>dirname</command></term>
  339. <listitem>
  340. <para>从文件名中删掉非目录的后缀</para>
  341. <indexterm zone="ch-system-coreutils dirname">
  342. <primary sortas="b-dirname">dirname</primary>
  343. </indexterm>
  344. </listitem>
  345. </varlistentry>
  346. <varlistentry id="du">
  347. <term><command>du</command></term>
  348. <listitem>
  349. <para>报告当前目录使用的磁盘空间,
  350. 给出当前目录下所有子目录和文件占用的空间</para>
  351. <indexterm zone="ch-system-coreutils du">
  352. <primary sortas="b-du">du</primary>
  353. </indexterm>
  354. </listitem>
  355. </varlistentry>
  356. <varlistentry id="echo">
  357. <term><command>echo</command></term>
  358. <listitem>
  359. <para>显示给定字符串</para>
  360. <indexterm zone="ch-system-coreutils echo">
  361. <primary sortas="b-echo">echo</primary>
  362. </indexterm>
  363. </listitem>
  364. </varlistentry>
  365. <varlistentry id="env">
  366. <term><command>env</command></term>
  367. <listitem>
  368. <para>在修改的环境中运行命令</para>
  369. <indexterm zone="ch-system-coreutils env">
  370. <primary sortas="b-env">env</primary>
  371. </indexterm>
  372. </listitem>
  373. </varlistentry>
  374. <varlistentry id="expand">
  375. <term><command>expand</command></term>
  376. <listitem>
  377. <para>将制表符转换成空格</para>
  378. <indexterm zone="ch-system-coreutils expand">
  379. <primary sortas="b-expand">expand</primary>
  380. </indexterm>
  381. </listitem>
  382. </varlistentry>
  383. <varlistentry id="expr">
  384. <term><command>expr</command></term>
  385. <listitem>
  386. <para>计算表达式</para>
  387. <indexterm zone="ch-system-coreutils expr">
  388. <primary sortas="b-expr">expr</primary>
  389. </indexterm>
  390. </listitem>
  391. </varlistentry>
  392. <varlistentry id="factor">
  393. <term><command>factor</command></term>
  394. <listitem>
  395. <para>打印所有给定整数的质因数</para>
  396. <indexterm zone="ch-system-coreutils factor">
  397. <primary sortas="b-factor">factor</primary>
  398. </indexterm>
  399. </listitem>
  400. </varlistentry>
  401. <varlistentry id="false">
  402. <term><command>false</command></term>
  403. <listitem>
  404. <para>什么也不做;总是以失败状态码退出;</para>
  405. <indexterm zone="ch-system-coreutils false">
  406. <primary sortas="b-false">false</primary>
  407. </indexterm>
  408. </listitem>
  409. </varlistentry>
  410. <varlistentry id="fmt">
  411. <term><command>fmt</command></term>
  412. <listitem>
  413. <para>重新格式化给定文件的段落</para>
  414. <indexterm zone="ch-system-coreutils fmt">
  415. <primary sortas="b-fmt">fmt</primary>
  416. </indexterm>
  417. </listitem>
  418. </varlistentry>
  419. <varlistentry id="fold">
  420. <term><command>fold</command></term>
  421. <listitem>
  422. <para>折叠给定文件中的行</para>
  423. <indexterm zone="ch-system-coreutils fold">
  424. <primary sortas="b-fold">fold</primary>
  425. </indexterm>
  426. </listitem>
  427. </varlistentry>
  428. <varlistentry id="groups">
  429. <term><command>groups</command></term>
  430. <listitem>
  431. <para>报告用户所属的组</para>
  432. <indexterm zone="ch-system-coreutils groups">
  433. <primary sortas="b-groups">groups</primary>
  434. </indexterm>
  435. </listitem>
  436. </varlistentry>
  437. <varlistentry id="head">
  438. <term><command>head</command></term>
  439. <listitem>
  440. <para>打印文件的前 10 (或给定行数)行</para>
  441. <indexterm zone="ch-system-coreutils head">
  442. <primary sortas="b-head">head</primary>
  443. </indexterm>
  444. </listitem>
  445. </varlistentry>
  446. <varlistentry id="hostid">
  447. <term><command>hostid</command></term>
  448. <listitem>
  449. <para>以十六进制格式打印主机数字标识符</para>
  450. <indexterm zone="ch-system-coreutils hostid">
  451. <primary sortas="b-hostid">hostid</primary>
  452. </indexterm>
  453. </listitem>
  454. </varlistentry>
  455. <varlistentry id="id">
  456. <term><command>id</command></term>
  457. <listitem>
  458. <para>报告当前用户或给定用户的有效用户 ID、组 ID 和所属的组
  459. </para>
  460. <indexterm zone="ch-system-coreutils id">
  461. <primary sortas="b-id">id</primary>
  462. </indexterm>
  463. </listitem>
  464. </varlistentry>
  465. <varlistentry id="install">
  466. <term><command>install</command> </term>
  467. <listitem>
  468. <para>复制文件并设定它们的访问权限,以及(如果可能)
  469. 它们的所有者和属组</para>
  470. <indexterm zone="ch-system-coreutils install">
  471. <primary sortas="b-install">install</primary>
  472. </indexterm>
  473. </listitem>
  474. </varlistentry>
  475. <varlistentry id="join">
  476. <term><command>join</command></term>
  477. <listitem>
  478. <para>将两个文件中拥有相同域的行合并</para>
  479. <indexterm zone="ch-system-coreutils join">
  480. <primary sortas="b-join">join</primary>
  481. </indexterm>
  482. </listitem>
  483. </varlistentry>
  484. <varlistentry id="link">
  485. <term><command>link</command></term>
  486. <listitem>
  487. <para>以给定文件名创建硬链接</para>
  488. <indexterm zone="ch-system-coreutils link">
  489. <primary sortas="b-link">link</primary>
  490. </indexterm>
  491. </listitem>
  492. </varlistentry>
  493. <varlistentry id="ln">
  494. <term><command>ln</command></term>
  495. <listitem>
  496. <para>在文件之间创建硬链接或软(符号)链接</para>
  497. <indexterm zone="ch-system-coreutils ln">
  498. <primary sortas="b-ln">ln</primary>
  499. </indexterm>
  500. </listitem>
  501. </varlistentry>
  502. <varlistentry id="logname">
  503. <term><command>logname</command></term>
  504. <listitem>
  505. <para>报告当前用户登录名</para>
  506. <indexterm zone="ch-system-coreutils logname">
  507. <primary sortas="b-logname">logname</primary>
  508. </indexterm>
  509. </listitem>
  510. </varlistentry>
  511. <varlistentry id="ls">
  512. <term><command>ls</command></term>
  513. <listitem>
  514. <para>列出给定目录内容</para>
  515. <indexterm zone="ch-system-coreutils ls">
  516. <primary sortas="b-ls">ls</primary>
  517. </indexterm>
  518. </listitem>
  519. </varlistentry>
  520. <varlistentry id="md5sum">
  521. <term><command>md5sum</command></term>
  522. <listitem>
  523. <para>报告或检查消息摘要 5 (MD5)校验和</para>
  524. <indexterm zone="ch-system-coreutils md5sum">
  525. <primary sortas="b-md5sum">md5sum</primary>
  526. </indexterm>
  527. </listitem>
  528. </varlistentry>
  529. <varlistentry id="mkdir">
  530. <term><command>mkdir</command></term>
  531. <listitem>
  532. <para>以给定名称创建目录</para>
  533. <indexterm zone="ch-system-coreutils mkdir">
  534. <primary sortas="b-mkdir">mkdir</primary>
  535. </indexterm>
  536. </listitem>
  537. </varlistentry>
  538. <varlistentry id="mkfifo">
  539. <term><command>mkfifo</command></term>
  540. <listitem>
  541. <para>以给定名称创建先进先出表(FIFO),
  542. 在 UNIX 惯用语中又称为 <quote>命名管道</quote></para>
  543. <indexterm zone="ch-system-coreutils mkfifo">
  544. <primary sortas="b-mkfifo">mkfifo</primary>
  545. </indexterm>
  546. </listitem>
  547. </varlistentry>
  548. <varlistentry id="mknod">
  549. <term><command>mknod</command></term>
  550. <listitem>
  551. <para>以给定名称创建设备节点;设备节点可能是字符特殊文件、
  552. 块特殊文件或 FIFO</para>
  553. <indexterm zone="ch-system-coreutils mknod">
  554. <primary sortas="b-mknod">mknod</primary>
  555. </indexterm>
  556. </listitem>
  557. </varlistentry>
  558. <varlistentry id="mktemp">
  559. <term><command>mktemp</command></term>
  560. <listitem>
  561. <para>安全地创建临时文件,常用在脚本中</para>
  562. <indexterm zone="ch-system-coreutils mktemp">
  563. <primary sortas="b-mktemp">mktemp</primary>
  564. </indexterm>
  565. </listitem>
  566. </varlistentry>
  567. <varlistentry id="mv">
  568. <term><command>mv</command></term>
  569. <listitem>
  570. <para>移动或重命名文件或目录</para>
  571. <indexterm zone="ch-system-coreutils mv">
  572. <primary sortas="b-mv">mv</primary>
  573. </indexterm>
  574. </listitem>
  575. </varlistentry>
  576. <varlistentry id="nice">
  577. <term><command>nice</command></term>
  578. <listitem>
  579. <para>以修改的调度优先级运行程序</para>
  580. <indexterm zone="ch-system-coreutils nice">
  581. <primary sortas="b-nice">nice</primary>
  582. </indexterm>
  583. </listitem>
  584. </varlistentry>
  585. <varlistentry id="nl">
  586. <term><command>nl</command></term>
  587. <listitem>
  588. <para>标出给定文件的行</para>
  589. <indexterm zone="ch-system-coreutils nl">
  590. <primary sortas="b-nl">nl</primary>
  591. </indexterm>
  592. </listitem>
  593. </varlistentry>
  594. <varlistentry id="nohup">
  595. <term><command>nohup</command></term>
  596. <listitem>
  597. <para>以免疫挂机信号的方式执行命令,同时将输出重定向到日志文件
  598. </para>
  599. <indexterm zone="ch-system-coreutils nohup">
  600. <primary sortas="b-nohup">nohup</primary>
  601. </indexterm>
  602. </listitem>
  603. </varlistentry>
  604. <varlistentry id="nproc">
  605. <term><command>nproc</command></term>
  606. <listitem>
  607. <para>打印进程可用的处理单元数目</para>
  608. <indexterm zone="ch-system-coreutils nproc">
  609. <primary sortas="b-nproc">nproc</primary>
  610. </indexterm>
  611. </listitem>
  612. </varlistentry>
  613. <varlistentry id="numfmt">
  614. <term><command>numfmt</command></term>
  615. <listitem>
  616. <para>在数字和人类可读字符串之间互相转换</para>
  617. <indexterm zone="ch-system-coreutils numfmt">
  618. <primary sortas="b-numfmt">numfmt</primary>
  619. </indexterm>
  620. </listitem>
  621. </varlistentry>
  622. <varlistentry id="od">
  623. <term><command>od</command></term>
  624. <listitem>
  625. <para>以八进制或其他格式转储文件</para>
  626. <indexterm zone="ch-system-coreutils od">
  627. <primary sortas="b-od">od</primary>
  628. </indexterm>
  629. </listitem>
  630. </varlistentry>
  631. <varlistentry id="paste">
  632. <term><command>paste</command></term>
  633. <listitem>
  634. <para>合并给定文件,将它们的对应行连接起来,以制表符分割</para>
  635. <indexterm zone="ch-system-coreutils paste">
  636. <primary sortas="b-paste">paste</primary>
  637. </indexterm>
  638. </listitem>
  639. </varlistentry>
  640. <varlistentry id="pathchk">
  641. <term><command>pathchk</command></term>
  642. <listitem>
  643. <para>检查文件名的有效性和可移植性</para>
  644. <indexterm zone="ch-system-coreutils pathchk">
  645. <primary sortas="b-pathchk">pathchk</primary>
  646. </indexterm>
  647. </listitem>
  648. </varlistentry>
  649. <varlistentry id="pinky">
  650. <term><command>pinky</command></term>
  651. <listitem>
  652. <para>是轻量级 finger 客户端,报告给定用户的一些信息</para>
  653. <indexterm zone="ch-system-coreutils pinky">
  654. <primary sortas="b-pinky">pinky</primary>
  655. </indexterm>
  656. </listitem>
  657. </varlistentry>
  658. <varlistentry id="pr">
  659. <term><command>pr</command></term>
  660. <listitem>
  661. <para>对文件进行分页和分栏以便打印</para>
  662. <indexterm zone="ch-system-coreutils pr">
  663. <primary sortas="b-pr">pr</primary>
  664. </indexterm>
  665. </listitem>
  666. </varlistentry>
  667. <varlistentry id="printenv">
  668. <term><command>printenv</command></term>
  669. <listitem>
  670. <para>打印环境变量</para>
  671. <indexterm zone="ch-system-coreutils printenv">
  672. <primary sortas="b-printenv">printenv</primary>
  673. </indexterm>
  674. </listitem>
  675. </varlistentry>
  676. <varlistentry id="printf">
  677. <term><command>printf</command></term>
  678. <listitem>
  679. <para>以给定格式打印给定参数,很像 C printf 函数</para>
  680. <indexterm zone="ch-system-coreutils printf">
  681. <primary sortas="b-printf">printf</primary>
  682. </indexterm>
  683. </listitem>
  684. </varlistentry>
  685. <varlistentry id="ptx">
  686. <term><command>ptx</command></term>
  687. <listitem>
  688. <para>用文中的每个关键字,根据给定文件内容生成重排索引</para>
  689. <indexterm zone="ch-system-coreutils ptx">
  690. <primary sortas="b-ptx">ptx</primary>
  691. </indexterm>
  692. </listitem>
  693. </varlistentry>
  694. <varlistentry id="pwd">
  695. <term><command>pwd</command></term>
  696. <listitem>
  697. <para>报告当前工作目录名</para>
  698. <indexterm zone="ch-system-coreutils pwd">
  699. <primary sortas="b-pwd">pwd</primary>
  700. </indexterm>
  701. </listitem>
  702. </varlistentry>
  703. <varlistentry id="readlink">
  704. <term><command>readlink</command></term>
  705. <listitem>
  706. <para>报告给定符号链接的值</para>
  707. <indexterm zone="ch-system-coreutils readlink">
  708. <primary sortas="b-readlink">readlink</primary>
  709. </indexterm>
  710. </listitem>
  711. </varlistentry>
  712. <varlistentry id="realpath">
  713. <term><command>realpath</command></term>
  714. <listitem>
  715. <para>打印解析过的目录</para>
  716. <indexterm zone="ch-system-coreutils realpath">
  717. <primary sortas="b-realpath">realpath</primary>
  718. </indexterm>
  719. </listitem>
  720. </varlistentry>
  721. <varlistentry id="rm">
  722. <term><command>rm</command></term>
  723. <listitem>
  724. <para>删除文件或目录</para>
  725. <indexterm zone="ch-system-coreutils rm">
  726. <primary sortas="b-rm">rm</primary>
  727. </indexterm>
  728. </listitem>
  729. </varlistentry>
  730. <varlistentry id="rmdir">
  731. <term><command>rmdir</command></term>
  732. <listitem>
  733. <para>如果目录是空的,删除它们</para>
  734. <indexterm zone="ch-system-coreutils rmdir">
  735. <primary sortas="b-rmdir">rmdir</primary>
  736. </indexterm>
  737. </listitem>
  738. </varlistentry>
  739. <varlistentry id="runcon">
  740. <term><command>runcon</command></term>
  741. <listitem>
  742. <para>以给定 SELinux 安全上下文运行命令</para>
  743. <indexterm zone="ch-system-coreutils runcon">
  744. <primary sortas="b-runcon">runcon</primary>
  745. </indexterm>
  746. </listitem>
  747. </varlistentry>
  748. <varlistentry id="seq">
  749. <term><command>seq</command></term>
  750. <listitem>
  751. <para>以给定的范围和增量打印等差数列</para>
  752. <indexterm zone="ch-system-coreutils seq">
  753. <primary sortas="b-seq">seq</primary>
  754. </indexterm>
  755. </listitem>
  756. </varlistentry>
  757. <varlistentry id="sha1sum">
  758. <term><command>sha1sum</command></term>
  759. <listitem>
  760. <para>打印或检查 160 位安全散列算法 1 (SHA1)校验和</para>
  761. <indexterm zone="ch-system-coreutils sha1sum">
  762. <primary sortas="b-sha1sum">sha1sum</primary>
  763. </indexterm>
  764. </listitem>
  765. </varlistentry>
  766. <varlistentry id="sha224sum">
  767. <term><command>sha224sum</command></term>
  768. <listitem>
  769. <para>打印或检查 224 位安全散列算法校验和</para>
  770. <indexterm zone="ch-system-coreutils sha224sum">
  771. <primary sortas="b-sha224sum">sha224sum</primary>
  772. </indexterm>
  773. </listitem>
  774. </varlistentry>
  775. <varlistentry id="sha256sum">
  776. <term><command>sha256sum</command></term>
  777. <listitem>
  778. <para>打印或检查 256 位安全散列算法校验和</para>
  779. <indexterm zone="ch-system-coreutils sha256sum">
  780. <primary sortas="b-sha256sum">sha256sum</primary>
  781. </indexterm>
  782. </listitem>
  783. </varlistentry>
  784. <varlistentry id="sha384sum">
  785. <term><command>sha384sum</command></term>
  786. <listitem>
  787. <para>打印或检查 384 位安全散列算法校验和</para>
  788. <indexterm zone="ch-system-coreutils sha384sum">
  789. <primary sortas="b-sha384sum">sha384sum</primary>
  790. </indexterm>
  791. </listitem>
  792. </varlistentry>
  793. <varlistentry id="sha512sum">
  794. <term><command>sha512sum</command></term>
  795. <listitem>
  796. <para>打印或检查 512 位安全散列算法校验和</para>
  797. <indexterm zone="ch-system-coreutils sha512sum">
  798. <primary sortas="b-sha512sum">sha512sum</primary>
  799. </indexterm>
  800. </listitem>
  801. </varlistentry>
  802. <varlistentry id="shred">
  803. <term><command>shred</command></term>
  804. <listitem>
  805. <para>将给定文件多次用复杂模式覆盖,增加恢复数据的难度</para>
  806. <indexterm zone="ch-system-coreutils shred">
  807. <primary sortas="b-shred">shred</primary>
  808. </indexterm>
  809. </listitem>
  810. </varlistentry>
  811. <varlistentry id="shuf">
  812. <term><command>shuf</command></term>
  813. <listitem>
  814. <para>打乱文件中的行</para>
  815. <indexterm zone="ch-system-coreutils shuf">
  816. <primary sortas="b-shuf">shuf</primary>
  817. </indexterm>
  818. </listitem>
  819. </varlistentry>
  820. <varlistentry id="sleep">
  821. <term><command>sleep</command></term>
  822. <listitem>
  823. <para>等待给定时间</para>
  824. <indexterm zone="ch-system-coreutils sleep">
  825. <primary sortas="b-sleep">sleep</primary>
  826. </indexterm>
  827. </listitem>
  828. </varlistentry>
  829. <varlistentry id="sort">
  830. <term><command>sort</command></term>
  831. <listitem>
  832. <para>对给定文件的行进行排序</para>
  833. <indexterm zone="ch-system-coreutils sort">
  834. <primary sortas="b-sort">sort</primary>
  835. </indexterm>
  836. </listitem>
  837. </varlistentry>
  838. <varlistentry id="split">
  839. <term><command>split</command></term>
  840. <listitem>
  841. <para>根据大小或行数,将指定文件分割成若干部分</para>
  842. <indexterm zone="ch-system-coreutils split">
  843. <primary sortas="b-split">split</primary>
  844. </indexterm>
  845. </listitem>
  846. </varlistentry>
  847. <varlistentry id="stat">
  848. <term><command>stat</command></term>
  849. <listitem>
  850. <para>显示文件或文件系统状态</para>
  851. <indexterm zone="ch-system-coreutils stat">
  852. <primary sortas="b-stat">stat</primary>
  853. </indexterm>
  854. </listitem>
  855. </varlistentry>
  856. <varlistentry id="stdbuf">
  857. <term><command>stdbuf</command></term>
  858. <listitem>
  859. <para>以修改的标准流缓冲操作运行命令</para>
  860. <indexterm zone="ch-system-coreutils stdbuf">
  861. <primary sortas="b-stdbuf">stdbuf</primary>
  862. </indexterm>
  863. </listitem>
  864. </varlistentry>
  865. <varlistentry id="stty">
  866. <term><command>stty</command></term>
  867. <listitem>
  868. <para>设置或报告终端行设定</para>
  869. <indexterm zone="ch-system-coreutils stty">
  870. <primary sortas="b-stty">stty</primary>
  871. </indexterm>
  872. </listitem>
  873. </varlistentry>
  874. <varlistentry id="sum">
  875. <term><command>sum</command></term>
  876. <listitem>
  877. <para>打印每个指定文件的校验和及块个数</para>
  878. <indexterm zone="ch-system-coreutils sum">
  879. <primary sortas="b-sum">sum</primary>
  880. </indexterm>
  881. </listitem>
  882. </varlistentry>
  883. <varlistentry id="sync">
  884. <term><command>sync</command></term>
  885. <listitem>
  886. <para>刷新文件系统缓冲;它将修改过的块强制写入磁盘,
  887. 并更新超级块</para>
  888. <indexterm zone="ch-system-coreutils sync">
  889. <primary sortas="b-sync">sync</primary>
  890. </indexterm>
  891. </listitem>
  892. </varlistentry>
  893. <varlistentry id="tac">
  894. <term><command>tac</command></term>
  895. <listitem>
  896. <para>逆序连接给定文件</para>
  897. <indexterm zone="ch-system-coreutils tac">
  898. <primary sortas="b-tac">tac</primary>
  899. </indexterm>
  900. </listitem>
  901. </varlistentry>
  902. <varlistentry id="tail">
  903. <term><command>tail</command></term>
  904. <listitem>
  905. <para>输出给定文件的最后 10 (或指定行数)行</para>
  906. <indexterm zone="ch-system-coreutils tail">
  907. <primary sortas="b-tail">tail</primary>
  908. </indexterm>
  909. </listitem>
  910. </varlistentry>
  911. <varlistentry id="tee">
  912. <term><command>tee</command></term>
  913. <listitem>
  914. <para>读取标准输入,并将内容同时写入标准输出和给定文件</para>
  915. <indexterm zone="ch-system-coreutils tee">
  916. <primary sortas="b-tee">tee</primary>
  917. </indexterm>
  918. </listitem>
  919. </varlistentry>
  920. <varlistentry id="test">
  921. <term><command>test</command></term>
  922. <listitem>
  923. <para>比较两个值,或检查文件类型</para>
  924. <indexterm zone="ch-system-coreutils test">
  925. <primary sortas="b-test">test</primary>
  926. </indexterm>
  927. </listitem>
  928. </varlistentry>
  929. <varlistentry id="timeout">
  930. <term><command>timeout</command></term>
  931. <listitem>
  932. <para>在限定时间内运行命令</para>
  933. <indexterm zone="ch-system-coreutils timeout">
  934. <primary sortas="b-timeout">timeout</primary>
  935. </indexterm>
  936. </listitem>
  937. </varlistentry>
  938. <varlistentry id="touch">
  939. <term><command>touch</command></term>
  940. <listitem>
  941. <para>修改文件时间戳,将每个给定文件的访问和修改时间设为当前时间;
  942. 以零长度创建当前不存在的文件</para>
  943. <indexterm zone="ch-system-coreutils touch">
  944. <primary sortas="b-touch">touch</primary>
  945. </indexterm>
  946. </listitem>
  947. </varlistentry>
  948. <varlistentry id="tr">
  949. <term><command>tr</command></term>
  950. <listitem>
  951. <para>从标准输入变换、压缩或删除给定字符</para>
  952. <indexterm zone="ch-system-coreutils tr">
  953. <primary sortas="b-tr">tr</primary>
  954. </indexterm>
  955. </listitem>
  956. </varlistentry>
  957. <varlistentry id="true">
  958. <term><command>true</command></term>
  959. <listitem>
  960. <para>什么也不做;总是以成功状态码退出</para>
  961. <indexterm zone="ch-system-coreutils true">
  962. <primary sortas="b-true">true</primary>
  963. </indexterm>
  964. </listitem>
  965. </varlistentry>
  966. <varlistentry id="truncate">
  967. <term><command>truncate</command></term>
  968. <listitem>
  969. <para>将文件截断或扩展到指定大小</para>
  970. <indexterm zone="ch-system-coreutils truncate">
  971. <primary sortas="b-truncate">truncate</primary>
  972. </indexterm>
  973. </listitem>
  974. </varlistentry>
  975. <varlistentry id="tsort">
  976. <term><command>tsort</command></term>
  977. <listitem>
  978. <para>进行拓扑排序;
  979. 根据给定文件的部分顺序信息输出完整的排序列表</para>
  980. <indexterm zone="ch-system-coreutils tsort">
  981. <primary sortas="b-tsort">tsort</primary>
  982. </indexterm>
  983. </listitem>
  984. </varlistentry>
  985. <varlistentry id="tty">
  986. <term><command>tty</command></term>
  987. <listitem>
  988. <para>报告标准输入的终端文件名</para>
  989. <indexterm zone="ch-system-coreutils tty">
  990. <primary sortas="b-tty">tty</primary>
  991. </indexterm>
  992. </listitem>
  993. </varlistentry>
  994. <varlistentry id="uname">
  995. <term><command>uname</command></term>
  996. <listitem>
  997. <para>报告系统信息</para>
  998. <indexterm zone="ch-system-coreutils uname">
  999. <primary sortas="b-uname">uname</primary>
  1000. </indexterm>
  1001. </listitem>
  1002. </varlistentry>
  1003. <varlistentry id="unexpand">
  1004. <term><command>unexpand</command></term>
  1005. <listitem>
  1006. <para>将空格转换成制表符</para>
  1007. <indexterm zone="ch-system-coreutils unexpand">
  1008. <primary sortas="b-unexpand">unexpand</primary>
  1009. </indexterm>
  1010. </listitem>
  1011. </varlistentry>
  1012. <varlistentry id="uniq">
  1013. <term><command>uniq</command></term>
  1014. <listitem>
  1015. <para>在连续的相同行中只保留一行,删除其他所有行</para>
  1016. <indexterm zone="ch-system-coreutils uniq">
  1017. <primary sortas="b-uniq">uniq</primary>
  1018. </indexterm>
  1019. </listitem>
  1020. </varlistentry>
  1021. <varlistentry id="unlink">
  1022. <term><command>unlink</command></term>
  1023. <listitem>
  1024. <para>删除给定文件</para>
  1025. <indexterm zone="ch-system-coreutils unlink">
  1026. <primary sortas="b-unlink">unlink</primary>
  1027. </indexterm>
  1028. </listitem>
  1029. </varlistentry>
  1030. <varlistentry id="users">
  1031. <term><command>users</command></term>
  1032. <listitem>
  1033. <para>报告当前登录系统的用户名</para>
  1034. <indexterm zone="ch-system-coreutils users">
  1035. <primary sortas="b-users">users</primary>
  1036. </indexterm>
  1037. </listitem>
  1038. </varlistentry>
  1039. <varlistentry id="vdir">
  1040. <term><command>vdir</command></term>
  1041. <listitem>
  1042. <para>和 <command>ls -l</command> 相同</para>
  1043. <indexterm zone="ch-system-coreutils vdir">
  1044. <primary sortas="b-vdir">vdir</primary>
  1045. </indexterm>
  1046. </listitem>
  1047. </varlistentry>
  1048. <varlistentry id="wc">
  1049. <term><command>wc</command></term>
  1050. <listitem>
  1051. <para>报告给定文件的行数、单词数和字节数</para>
  1052. <indexterm zone="ch-system-coreutils wc">
  1053. <primary sortas="b-wc">wc</primary>
  1054. </indexterm>
  1055. </listitem>
  1056. </varlistentry>
  1057. <varlistentry id="who">
  1058. <term><command>who</command></term>
  1059. <listitem>
  1060. <para>报告当前登录的用户</para>
  1061. <indexterm zone="ch-system-coreutils who">
  1062. <primary sortas="b-who">who</primary>
  1063. </indexterm>
  1064. </listitem>
  1065. </varlistentry>
  1066. <varlistentry id="whoami">
  1067. <term><command>whoami</command></term>
  1068. <listitem>
  1069. <para>报告与当前有效用户 ID 相关的用户名</para>
  1070. <indexterm zone="ch-system-coreutils whoami">
  1071. <primary sortas="b-whoami">whoami</primary>
  1072. </indexterm>
  1073. </listitem>
  1074. </varlistentry>
  1075. <varlistentry id="yes">
  1076. <term><command>yes</command></term>
  1077. <listitem>
  1078. <para>不停输出 <quote>y</quote> 或给定字符串,直到被杀死</para>
  1079. <indexterm zone="ch-system-coreutils yes">
  1080. <primary sortas="b-yes">yes</primary>
  1081. </indexterm>
  1082. </listitem>
  1083. </varlistentry>
  1084. <varlistentry id="libstdbuf">
  1085. <term><filename class="libraryfile">libstdbuf</filename></term>
  1086. <listitem>
  1087. <para><command>stdbuf</command> 使用的库</para>
  1088. <indexterm zone="ch-system-coreutils libstdbuf">
  1089. <primary sortas="c-libstdbuf">libstdbuf</primary>
  1090. </indexterm>
  1091. </listitem>
  1092. </varlistentry>
  1093. </variablelist>
  1094. </sect2>
  1095. </sect1>