Files

16 lines
306 B
Plaintext
Raw Permalink 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.
#
2015-05-16 00:14:14 +02:00
db="/var/db/locate.db";
2015-05-14 18:34:10 +02:00
2015-05-16 00:14:14 +02:00
echo -n > $db
find / -ls | egrep -v "^\/proc|dev|tmp" | dbtool -d $db -i -f -R -t "^(.+?) (\/.*)$";