[519ee45] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-system-findutils" role="wrap">
|
---|
| 9 | <?dbhtml filename="findutils.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Findutils-&findutils-version;</title>
|
---|
| 12 |
|
---|
| 13 | <indexterm zone="ch-system-findutils">
|
---|
| 14 | <primary sortas="a-Findutils">Findutils</primary>
|
---|
| 15 | </indexterm>
|
---|
| 16 |
|
---|
| 17 | <sect2 role="package">
|
---|
| 18 | <title/>
|
---|
| 19 |
|
---|
| 20 | <para>The Findutils package contains programs to find files. These programs
|
---|
| 21 | are provided to recursively search through a directory tree and to
|
---|
| 22 | create, maintain, and search a database (often faster than the recursive
|
---|
| 23 | find, but unreliable if the database has not been recently updated).</para>
|
---|
| 24 |
|
---|
| 25 | <segmentedlist>
|
---|
| 26 | <segtitle>&buildtime;</segtitle>
|
---|
| 27 | <segtitle>&diskspace;</segtitle>
|
---|
| 28 |
|
---|
| 29 | <seglistitem>
|
---|
| 30 | <seg>&findutils-ch6-sbu;</seg>
|
---|
| 31 | <seg>&findutils-ch6-du;</seg>
|
---|
| 32 | </seglistitem>
|
---|
| 33 | </segmentedlist>
|
---|
| 34 |
|
---|
| 35 | </sect2>
|
---|
| 36 |
|
---|
| 37 | <sect2 role="installation">
|
---|
| 38 | <title>Installation of Findutils</title>
|
---|
| 39 |
|
---|
| 40 | <para>Prepare Findutils for compilation:</para>
|
---|
| 41 |
|
---|
| 42 | <screen><userinput>./configure --prefix=/usr --libexecdir=/usr/lib/findutils \
|
---|
| 43 | --localstatedir=/var/lib/locate</userinput></screen>
|
---|
| 44 |
|
---|
| 45 | <variablelist>
|
---|
| 46 | <title>The meaning of the configure options:</title>
|
---|
| 47 |
|
---|
| 48 | <varlistentry>
|
---|
| 49 | <term><parameter>--localstatedir</parameter></term>
|
---|
| 50 | <listitem>
|
---|
| 51 | <para>This option changes the location of the <command>locate</command>
|
---|
| 52 | database to be in <filename class="directory">/var/lib/locate</filename>,
|
---|
| 53 | which is FHS-compliant.</para>
|
---|
| 54 | </listitem>
|
---|
| 55 | </varlistentry>
|
---|
| 56 |
|
---|
| 57 | </variablelist>
|
---|
| 58 |
|
---|
| 59 | <para>Compile the package:</para>
|
---|
| 60 |
|
---|
| 61 | <screen><userinput>make</userinput></screen>
|
---|
| 62 |
|
---|
| 63 | <para>To test the results, issue:
|
---|
| 64 | <userinput>make check</userinput>.</para>
|
---|
| 65 |
|
---|
| 66 | <para>Install the package:</para>
|
---|
| 67 |
|
---|
| 68 | <screen><userinput>make install</userinput></screen>
|
---|
| 69 |
|
---|
| 70 | <para>Some of the scripts in the LFS-Bootscripts package depend on
|
---|
| 71 | <command>find</command>. As <filename class="directory">/usr</filename>
|
---|
| 72 | may not be available during the early stages of booting, this program
|
---|
| 73 | needs to be on the root partition. The <command>updatedb</command>
|
---|
[a76cbca] | 74 | script also needs to be modified to correct an explicit path:</para>
|
---|
[519ee45] | 75 |
|
---|
| 76 | <screen><userinput>mv -v /usr/bin/find /bin</userinput>
|
---|
| 77 | sed -i -e 's/find:=${BINDIR}/find:=\/bin/' /usr/bin/updatedb</screen>
|
---|
| 78 |
|
---|
| 79 | </sect2>
|
---|
| 80 |
|
---|
| 81 | <sect2 id="contents-findutils" role="content">
|
---|
| 82 | <title>Contents of Findutils</title>
|
---|
| 83 |
|
---|
| 84 | <segmentedlist>
|
---|
| 85 | <segtitle>Installed programs</segtitle>
|
---|
| 86 |
|
---|
| 87 | <seglistitem>
|
---|
| 88 | <seg>bigram, code, find, frcode, locate, updatedb, and xargs</seg>
|
---|
| 89 | </seglistitem>
|
---|
| 90 | </segmentedlist>
|
---|
| 91 |
|
---|
| 92 | <variablelist>
|
---|
| 93 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 94 | <?dbfo list-presentation="list"?>
|
---|
| 95 | <?dbhtml list-presentation="table"?>
|
---|
| 96 |
|
---|
| 97 | <varlistentry id="bigram">
|
---|
| 98 | <term><command>bigram</command></term>
|
---|
| 99 | <listitem>
|
---|
| 100 | <para>Was formerly used to produce <command>locate</command>
|
---|
| 101 | databases</para>
|
---|
| 102 | <indexterm zone="ch-system-findutils bigram">
|
---|
| 103 | <primary sortas="b-bigram">bigram</primary>
|
---|
| 104 | </indexterm>
|
---|
| 105 | </listitem>
|
---|
| 106 | </varlistentry>
|
---|
| 107 |
|
---|
| 108 | <varlistentry id="code">
|
---|
| 109 | <term><command>code</command></term>
|
---|
| 110 | <listitem>
|
---|
| 111 | <para>Was formerly used to produce <command>locate</command>
|
---|
| 112 | databases; it is the ancestor of <command>frcode</command>.</para>
|
---|
| 113 | <indexterm zone="ch-system-findutils code">
|
---|
| 114 | <primary sortas="b-code">code</primary>
|
---|
| 115 | </indexterm>
|
---|
| 116 | </listitem>
|
---|
| 117 | </varlistentry>
|
---|
| 118 |
|
---|
| 119 | <varlistentry id="find">
|
---|
| 120 | <term><command>find</command></term>
|
---|
| 121 | <listitem>
|
---|
| 122 | <para>Searches given directory trees for files matching the specified
|
---|
| 123 | criteria</para>
|
---|
| 124 | <indexterm zone="ch-system-findutils find">
|
---|
| 125 | <primary sortas="b-find">find</primary>
|
---|
| 126 | </indexterm>
|
---|
| 127 | </listitem>
|
---|
| 128 | </varlistentry>
|
---|
| 129 |
|
---|
| 130 | <varlistentry id="frcode">
|
---|
| 131 | <term><command>frcode</command></term>
|
---|
| 132 | <listitem>
|
---|
| 133 | <para>Is called by <command>updatedb</command> to compress the list
|
---|
| 134 | of file names; it uses front-compression, reducing the database size
|
---|
| 135 | by a factor of four to five.</para>
|
---|
| 136 | <indexterm zone="ch-system-findutils frcode">
|
---|
| 137 | <primary sortas="b-frcode">frcode</primary>
|
---|
| 138 | </indexterm>
|
---|
| 139 | </listitem>
|
---|
| 140 | </varlistentry>
|
---|
| 141 |
|
---|
| 142 | <varlistentry id="locate">
|
---|
| 143 | <term><command>locate</command></term>
|
---|
| 144 | <listitem>
|
---|
| 145 | <para>Searches through a database of file names and reports the names
|
---|
| 146 | that contain a given string or match a given pattern</para>
|
---|
| 147 | <indexterm zone="ch-system-findutils locate">
|
---|
| 148 | <primary sortas="b-locate">locate</primary>
|
---|
| 149 | </indexterm>
|
---|
| 150 | </listitem>
|
---|
| 151 | </varlistentry>
|
---|
| 152 |
|
---|
| 153 | <varlistentry id="updatedb">
|
---|
| 154 | <term><command>updatedb</command></term>
|
---|
| 155 | <listitem>
|
---|
| 156 | <para>Updates the <command>locate</command> database; it scans the
|
---|
| 157 | entire file system (including other file systems that are currently
|
---|
| 158 | mounted, unless told not to) and puts every file name it finds into
|
---|
| 159 | the database</para>
|
---|
| 160 | <indexterm zone="ch-system-findutils updatedb">
|
---|
| 161 | <primary sortas="b-updatedb">updatedb</primary>
|
---|
| 162 | </indexterm>
|
---|
| 163 | </listitem>
|
---|
| 164 | </varlistentry>
|
---|
| 165 |
|
---|
| 166 | <varlistentry id="xargs">
|
---|
| 167 | <term><command>xargs</command></term>
|
---|
| 168 | <listitem>
|
---|
| 169 | <para>Can be used to apply a given command to a list of files</para>
|
---|
| 170 | <indexterm zone="ch-system-findutils xargs">
|
---|
| 171 | <primary sortas="b-xargs">xargs</primary>
|
---|
| 172 | </indexterm>
|
---|
| 173 | </listitem>
|
---|
| 174 | </varlistentry>
|
---|
| 175 |
|
---|
| 176 | </variablelist>
|
---|
| 177 |
|
---|
| 178 | </sect2>
|
---|
| 179 |
|
---|
| 180 | </sect1>
|
---|