Find files with locate

As far as I know, Minix does not come with a 'locate' utillity. So it was time to create my own. It is based upon 'find' for collecting the file and pathnames and on 'grep' for going through the database. The 'locate' file is a script with the following content:

#! /usr/bin/sh

cat /locations | grep $1 
   
The file 'locations' which is in the root directory is filtered by grep and the result is sent to the screen. In Linux, the first line would not be necessary, but in Minix it is essential.

Update the 'locations' file with 'updatedb'

Below is the source of 'updatedb'.

#! /usr/bin/sh

find / -print >/locations
   
The payload of this scripts uses 'find' to find all filenames from the root directory and up/down. The results are printed to screen, which is redirected to the file 'locations' in the root directory.

Page created on 30 September 2007 and

Page equipped with FroogleBuster technology