Add some minor text tweaks
[linux_from_scratch.git] / chapter06 / findutils.xml
blobf7ca0578bb777e5b215436fcebf834dfd1bcbeaa
1 <?xml version="1.0" encoding="ISO-8859-1"?>
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 ]>
8 <sect1 id="ch-system-findutils" role="wrap">
9   <?dbhtml filename="findutils.html"?>
11   <sect1info condition="script">
12     <productname>findutils</productname>
13     <productnumber>&findutils-version;</productnumber>
14     <address>&findutils-url;</address>
15   </sect1info>
17   <title>Findutils-&findutils-version;</title>
19   <indexterm zone="ch-system-findutils">
20     <primary sortas="a-Findutils">Findutils</primary>
21   </indexterm>
23   <sect2 role="package">
24     <title/>
26     <para>The Findutils package contains programs to find files. These programs
27     are provided to recursively search through a directory tree and to
28     create, maintain, and search a database (often faster than the recursive
29     find, but unreliable if the database has not been recently updated).</para>
31     <segmentedlist>
32       <segtitle>&buildtime;</segtitle>
33       <segtitle>&diskspace;</segtitle>
35       <seglistitem>
36         <seg>&findutils-ch6-sbu;</seg>
37         <seg>&findutils-ch6-du;</seg>
38       </seglistitem>
39     </segmentedlist>
41   </sect2>
43   <sect2 role="installation">
44     <title>Installation of Findutils</title>
46    <!-- this has been fixed in upstream gnulib, when a new version of
47    findutils is released, please check #4055 to see if the change has been
48    picked up in this package -->
49    <para>First, suppress a test which on some machines can loop forever:</para>
51 <screen><userinput remap="pre">sed -i 's/test-lock..EXEEXT.//' tests/Makefile.in</userinput></screen>
53     <para>Next, make some fixes required by glibc-2.28 and later:</para>
55 <screen><userinput remap="pre">sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' gl/lib/*.c
56 sed -i '/unistd/a #include &lt;sys/sysmacros.h&gt;' gl/lib/mountlist.c
57 echo "#define _IO_IN_BACKUP 0x100" >> gl/lib/stdio-impl.h</userinput></screen>
59     <para>Prepare Findutils for compilation:</para>
61 <screen><userinput remap="configure">./configure --prefix=/usr --localstatedir=/var/lib/locate</userinput></screen>
63     <variablelist>
64       <title>The meaning of the configure options:</title>
66       <varlistentry>
67         <term><parameter>--localstatedir</parameter></term>
68         <listitem>
69           <para>This option changes the location of the <command>locate</command>
70           database to be in <filename class="directory">/var/lib/locate</filename>,
71           which is FHS-compliant.</para>
72         </listitem>
73       </varlistentry>
75     </variablelist>
77     <para>Compile the package:</para>
79 <screen><userinput remap="make">make</userinput></screen>
81     <para>To test the results, issue:</para>
83 <screen><userinput remap="test">make check</userinput></screen>
85     <para>Install the package:</para>
87 <screen><userinput remap="install">make install</userinput></screen>
89     <para revision="sysv">Some of the scripts in the LFS-Bootscripts package
90     depend on <command>find</command>.  As <filename
91     class="directory">/usr</filename> may not be available during the early
92     stages of booting, this program needs to be on the root partition.  The
93     <command>updatedb</command> script also needs to be modified to correct an
94     explicit path:</para>
96     <para revision="systemd"> Some packages in BLFS and beyond expect the
97     <command>find</command> program in <filename
98     class="directory">/bin</filename>, so make sure it's placed there:</para>
100 <screen><userinput remap="install">mv -v /usr/bin/find /bin
101 sed -i 's|find:=${BINDIR}|find:=/bin|' /usr/bin/updatedb</userinput></screen>
103   </sect2>
105   <sect2 id="contents-findutils" role="content">
106     <title>Contents of Findutils</title>
108     <segmentedlist>
109       <segtitle>Installed programs</segtitle>
111       <seglistitem>
112         <seg>code, find, locate, oldfind, updatedb, and xargs</seg>
113       </seglistitem>
114     </segmentedlist>
116     <variablelist>
117       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
118       <?dbfo list-presentation="list"?>
119       <?dbhtml list-presentation="table"?>
121       <varlistentry id="code">
122         <term><command>code</command></term>
123         <listitem>
124           <para>Was formerly used to produce <command>locate</command>
125           databases; it is the ancestor of <command>frcode</command></para>
126           <indexterm zone="ch-system-findutils code">
127             <primary sortas="b-code">code</primary>
128           </indexterm>
129         </listitem>
130       </varlistentry>
132       <varlistentry id="find">
133         <term><command>find</command></term>
134         <listitem>
135           <para>Searches given directory trees for files matching the specified
136           criteria</para>
137           <indexterm zone="ch-system-findutils find">
138             <primary sortas="b-find">find</primary>
139           </indexterm>
140         </listitem>
141       </varlistentry>
143       <varlistentry id="locate">
144         <term><command>locate</command></term>
145         <listitem>
146           <para>Searches through a database of file names and reports the names
147           that contain a given string or match a given pattern</para>
148           <indexterm zone="ch-system-findutils locate">
149             <primary sortas="b-locate">locate</primary>
150           </indexterm>
151         </listitem>
152       </varlistentry>
154       <varlistentry id="oldfind">
155         <term><command>oldfind</command></term>
156         <listitem>
157           <para>Older version of find, using a different algorithm</para>
158           <indexterm zone="ch-system-findutils oldfind">
159             <primary sortas="b-oldfind">oldfind</primary>
160           </indexterm>
161         </listitem>
162       </varlistentry>
164       <varlistentry id="updatedb">
165       <term><command>updatedb</command></term>
166         <listitem>
167           <para>Updates the <command>locate</command> database; it scans the
168           entire file system (including other file systems that are currently
169           mounted, unless told not to) and puts every file name it finds into
170           the database</para>
171           <indexterm zone="ch-system-findutils updatedb">
172             <primary sortas="b-updatedb">updatedb</primary>
173           </indexterm>
174         </listitem>
175       </varlistentry>
177       <varlistentry id="xargs">
178         <term><command>xargs</command></term>
179         <listitem>
180           <para>Can be used to apply a given command to a list of files</para>
181           <indexterm zone="ch-system-findutils xargs">
182             <primary sortas="b-xargs">xargs</primary>
183           </indexterm>
184         </listitem>
185       </varlistentry>
187     </variablelist>
189   </sect2>
191 </sect1>