Estimated build time: 1 minute Estimated required disk space: 3 MB |
Before Findutils is installed the findutils patch file has to be unpacked.
Install Findutils by running the following commands:
patch -Np1 -i ../findutils-4.1.patch && ./configure --prefix=/usr && make && make libexecdir=/usr/bin install |
By default, the location of the updatedb database is in /usr/var. If you would rather be FHS compliant, you may wish to use another location. The following commands use the database file /var/lib/misc/locatedb which is FHS compliant.
patch -Np1 -i ../findutils-4.1.patch && ./configure --prefix=/usr && make localstatedir=/var/lib/misc && make localstatedir=/var/lib/misc libexecdir=/usr/bin install |
patch -Np1 -i ../findutils-4.1.patch: This patch is to fix some compilation errors by avoiding a variable conflict and changing some bad syntax.
The Findutils package contains the bigram, code, find, frcode, locate, updatedb and xargs programs.
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.
code is the ancestor of frcode. It was used in older-style locate databases.
The find program searches for files in a directory hierarchy which match a certain criteria. If no criteria is given, it lists all files in the current directory and its subdirectories.
updatedb runs a program called frcode to compress the list of file names using front-compression, which reduces the database size by a factor of 4 to 5.
Locate scans a database which contain all files and directories on a filesystem. This program lists the files and directories in this database matching a certain criteria. If a user is looking for a file this program will scan the database and tell him exactly where the files he requested are located. This only makes sense if the locate database is fairly up-to-date else it will provide out-of-date information.
The updatedb program updates the locate database. It scans the entire file system (including other file system that are currently mounted unless it is told not to do so) and puts every directory and file it finds into the database that's used by the locate program which retrieves this information. It's good practice to update this database once a day to have it up-to-date whenever it is needed.
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 that command on the list.
Findutils-4.1 needs the following to be installed:
sh from the bash package
ar from the binutils package
as from the binutils package
ld from the binutils package
chmod from the fileutils package
cp from the fileutils package
mv from the fileutils package
rm from the fileutils package
grep from the grep package
cc from the gcc package
make from the make package
patch from the patch package
sed from the sed package
basename from the sh-utils package
date from the sh-utils package
cat from the textutils package
tr from the textutils package