Files
dbtool/samples/locate/updatedb

20 lines
398 B
Plaintext
Raw Normal View History

2015-05-14 18:34:10 +02:00
#!/bin/sh
#
# simple locate alike
# written as an example how to
# use dbtool.
#
# updatedb creates the database
# which is then used by locate
# to search for a certain string.
#
dbtool="/usr/bin/dbtool";
find="/usr/bin/find";
db="/var/local/locate.db";
egrep="/bin/egrep";
cp="/bin/cp"
$cp /dev/null $db;
$find / -ls | $egrep -v "^\/proc|dev|tmp" | $dbtool -d $db -i -f -R -t "^(.+?) (\/.*)$";