123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- <?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-findutils" role="wrap">
- <?dbhtml filename="findutils.html"?>
- <sect1info condition="script">
- <productname>findutils</productname>
- <productnumber>&findutils-version;</productnumber>
- <address>&findutils-url;</address>
- </sect1info>
- <title>Findutils-&findutils-version;</title>
- <indexterm zone="ch-system-findutils">
- <primary sortas="a-Findutils">Findutils</primary>
- </indexterm>
- <sect2 role="package">
- <title/>
- <para>Findutils 软件包包含用于查找文件的程序。
- 这些程序能够递归地搜索目录树,以及创建、维护和搜索数据库
- (一般比递归搜索快,但在数据库最近没有更新时不可靠)。</para>
- <segmentedlist>
- <segtitle>&buildtime;</segtitle>
- <segtitle>&diskspace;</segtitle>
- <seglistitem>
- <seg>&findutils-ch6-sbu;</seg>
- <seg>&findutils-ch6-du;</seg>
- </seglistitem>
- </segmentedlist>
- </sect2>
- <sect2 role="installation">
- <title>安装 Findutils</title>
- <!-- this has been fixed in upstream gnulib, when a new version of
- findutils 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 's/test-lock..EXEEXT.//' tests/Makefile.in</userinput></screen>
- <para>然后,进行 glibc-2.28 要求的一些修补:</para>
- <screen><userinput remap="pre">sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' gl/lib/*.c
- sed -i '/unistd/a #include <sys/sysmacros.h>' gl/lib/mountlist.c
- echo "#define _IO_IN_BACKUP 0x100" >> gl/lib/stdio-impl.h</userinput></screen>
- <para>准备安装 Findutils:</para>
- <screen><userinput remap="configure">./configure --prefix=/usr --localstatedir=/var/lib/locate</userinput></screen>
- <variablelist>
- <title>配置选项的含义:</title>
- <varlistentry>
- <term><parameter>--localstatedir</parameter></term>
- <listitem>
- <para>该选项将 <command>locate</command>
- 数据库的位置改为
- <filename class="directory">/var/lib/locate</filename>,
- 以与 FHS 兼容。
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>编译该软件包:</para>
- <screen><userinput remap="make">make</userinput></screen>
- <para>运行以下命令以测试编译结果:</para>
- <screen><userinput remap="test">make check</userinput></screen>
- <para>安装该软件包:</para>
- <screen><userinput remap="install">make install</userinput></screen>
- <para revision="sysv">LFS-Bootscripts 软件包中的某些脚本依赖于
- <command>find</command>。由于
- <filename class="directory">/usr</filename>
- 在引导早期阶段可能不可用,需要将这个程序移动到根分区。
- <command>updatedb</command> 脚本也需要进行修改,
- 以修正一个显式指定的路径:</para>
- <para revision="systemd"> BLFS 及 BLFS 之外的一些软件包预期
- <command>find</command> 程序在 <filename
- class="directory">/bin</filename> 中,因此要保证它被放置在那里:</para>
- <screen><userinput remap="install">mv -v /usr/bin/find /bin
- sed -i 's|find:=${BINDIR}|find:=/bin|' /usr/bin/updatedb</userinput></screen>
- </sect2>
- <sect2 id="contents-findutils" role="content">
- <title>Findutils 的内容</title>
- <segmentedlist>
- <segtitle>安装的程序</segtitle>
- <seglistitem>
- <seg>code, find, locate, oldfind, updatedb, 以及 xargs</seg>
- </seglistitem>
- </segmentedlist>
- <variablelist>
- <bridgehead renderas="sect3">简要描述</bridgehead>
- <?dbfo list-presentation="list"?>
- <?dbhtml list-presentation="table"?>
- <varlistentry id="code">
- <term><command>code</command></term>
- <listitem>
- <para>曾经被用于创建 <command>locate</command>
- 数据库;是 <command>frcode</command> 的前身</para>
- <indexterm zone="ch-system-findutils code">
- <primary sortas="b-code">code</primary>
- </indexterm>
- </listitem>
- </varlistentry>
- <varlistentry id="find">
- <term><command>find</command></term>
- <listitem>
- <para>在给定目录树中搜索满足给定条件的文件</para>
- <indexterm zone="ch-system-findutils find">
- <primary sortas="b-find">find</primary>
- </indexterm>
- </listitem>
- </varlistentry>
- <varlistentry id="locate">
- <term><command>locate</command></term>
- <listitem>
- <para>在文件名数据库中进行搜索,
- 报告包含特定字符串或匹配特定模式的文件名</para>
- <indexterm zone="ch-system-findutils locate">
- <primary sortas="b-locate">locate</primary>
- </indexterm>
- </listitem>
- </varlistentry>
- <varlistentry id="oldfind">
- <term><command>oldfind</command></term>
- <listitem>
- <para>旧版的 find ,使用不同的算法</para>
- <indexterm zone="ch-system-findutils oldfind">
- <primary sortas="b-oldfind">oldfind</primary>
- </indexterm>
- </listitem>
- </varlistentry>
- <varlistentry id="updatedb">
- <term><command>updatedb</command></term>
- <listitem>
- <para>更新 <command>locate</command> 数据库;
- 它扫描整个文件系统(包括当前挂载的其他文件系统,
- 除非被告知不这样做),并把找到的所有文件名加入数据库</para>
- <indexterm zone="ch-system-findutils updatedb">
- <primary sortas="b-updatedb">updatedb</primary>
- </indexterm>
- </listitem>
- </varlistentry>
- <varlistentry id="xargs">
- <term><command>xargs</command></term>
- <listitem>
- <para>可以将给定命令作用于一个列表中的所有文件</para>
- <indexterm zone="ch-system-findutils xargs">
- <primary sortas="b-xargs">xargs</primary>
- </indexterm>
- </listitem>
- </varlistentry>
- </variablelist>
- </sect2>
- </sect1>
|