?? findutils.html
字號:
<HTML><HEAD><TITLE>Installing Findutils-4.1</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.63"><LINKREL="HOME"TITLE="Linux From Scratch"HREF="../index.html"><LINKREL="UP"TITLE="Installing basic system software"HREF="../chapter06/chapter06.html"><LINKREL="PREVIOUS"TITLE="Installing Man-pages-1.43"HREF="../chapter06/man-pages.html"><LINKREL="NEXT"TITLE="Installing Mawk-1.3.3"HREF="../chapter06/mawk.html"></HEAD><BODYCLASS="sect1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Linux From Scratch: Version 3.1</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="../chapter06/man-pages.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 6. Installing basic system software</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="../chapter06/mawk.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="sect1"><H1CLASS="sect1"><ANAME="ch06-findutils">6.8. Installing Findutils-4.1</A></H1><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen">Estimated build time: 1 minuteEstimated required disk space: 3 MB</PRE></FONT></TD></TR></TABLE><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN1858">6.8.1. Installing Findutils</A></H2><P>Before Findutils is installed the findutils patch file has to be unpacked.</P><P>Install Findutils by running the following commands:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>patch -Np1 -i ../findutils-4.1.patch &&./configure --prefix=/usr &&make &&make libexecdir=/usr/bin install</B></TT></PRE></FONT></TD></TR></TABLE></P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN1865">6.8.2. FHS compliance notes</A></H2><P>By default, the location of the updatedb database is in /usr/var.If you would rather be FHS compliant, you may wish to use anotherlocation. The following commands use the database file <TTCLASS="filename">/var/lib/misc/locatedb</TT> which is FHS compliant.</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>patch -Np1 -i ../findutils-4.1.patch &&./configure --prefix=/usr &&make localstatedir=/var/lib/misc &&make localstatedir=/var/lib/misc libexecdir=/usr/bin install</B></TT></PRE></FONT></TD></TR></TABLE></P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN1872">6.8.3. Command explanations</A></H2><P><TTCLASS="userinput"><B>patch -Np1 -i ../findutils-4.1.patch</B></TT>: This patch is to fix some compilation errors byavoiding a variable conflict and changing some bad syntax.</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN1876">6.8.4. Contents</A></H2><P>The Findutils package contains the bigram, code, find, frcode, locate, updatedb and xargs programs.</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN1879">6.8.5. Description</A></H2><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN1881">6.8.5.1. bigram</A></H3><P>bigram is used together with code to produce older-style locate databases. To learn more about these last three programs, read the locatedb.5 manual page.</P></DIV><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN1884">6.8.5.2. code</A></H3><P>code is the ancestor of frcode. It was used in older-style locate databases.</P></DIV><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN1887">6.8.5.3. find</A></H3><P>The find program searches for files in a directory hierarchy which matcha certain criteria. If no criteria is given, it lists all files in thecurrent directory and its subdirectories.</P></DIV><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN1890">6.8.5.4. frcode</A></H3><P>updatedb runs a program called frcode to compress the list of file namesusing front-compression, which reduces the database size by a factor of4 to 5.</P></DIV><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN1893">6.8.5.5. locate</A></H3><P>Locate scans a database which contain all files and directories on afilesystem. This program lists the files and directories in thisdatabase matching a certain criteria. If a user is looking for a file thisprogram will scan the database and tell him exactly where the files herequested are located. This only makes sense if the locate database isfairly up-to-date else it will provide out-of-date information.</P></DIV><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN1896">6.8.5.6. updatedb</A></H3><P>The updatedb program updates the locate database. It scans the entirefile system (including other file system that are currently mountedunless it is told not to do so) and puts every directory and file it findsinto the database that's used by the locate program which retrieves thisinformation. It's good practice to update this database once a day tohave it up-to-date whenever it is needed.</P></DIV><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN1899">6.8.5.7. xargs</A></H3><P>The xargs command applies a command to a list of files. If there is a need to perform the same command on multiple files, a file can be created that contains all these files (one per line) and use xargs to perform thatcommand on the list.</P></DIV></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN1902">6.8.6. Dependencies</A></H2><P>Findutils-4.1 needs the following to be installed:</P><PCLASS="literallayout"><br>sh from the bash package<br><br>ar from the binutils package<br>as from the binutils package<br>ld from the binutils package<br><br>chmod from the fileutils package<br>cp from the fileutils package<br>mv from the fileutils package<br>rm from the fileutils package<br><br>grep from the grep package<br><br>cc from the gcc package<br><br>make from the make package<br><br>patch from the patch package<br><br>sed from the sed package<br><br>basename from the sh-utils package<br>date from the sh-utils package<br><br>cat from the textutils package<br>tr from the textutils package<br></P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="../chapter06/man-pages.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../index.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="../chapter06/mawk.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Installing Man-pages-1.43</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../chapter06/chapter06.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Installing Mawk-1.3.3</TD></TR></TABLE></DIV></BODY></HTML>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -