Android and Linux

Sunday, May 23, 2010

I polished and uploaded my locate script to L.E.S. Linux. It can be found in L.E.S. under the name "" or here:
#! /system/bin/sh

if test -z "$1"; then exec echo "USAGE: [filename|-u|--help]"; fi

case "$1" in
echo ' by fubaya (
This is a cheap imitation of the UNIX locate command. It stores
a list of all the files on your system to /sdcard/.locatedb (about 2MB)
then greps that file to find whatever you are looking for.

USAGE: [filename|-u|--help]

[filename] case insensitive search for any file of any type.

-u update the "database." This must be ran periodically if you want to
find new files. I have it set to run at boot on phone.

--help display this help message

EXAMPLE: $ cd /; touch /data/testfile
$ testfile
$ -u
database updated
$ testfile
find / -print > /sdcard/.locatedb && echo "database updated"
grep -i "$1" /sdcard/.locatedb

Copy to your clipboard with this QR code: