From: Jochen Cichon (jc@versainter.net)
Date: Mon Nov 13 2000 - 16:18:52 CET
> usr/bin/locate:
> grep "$1" /var/locatedb
OK thats easy!
> /usr/bin/updatedb:
> rm /tmp/locatedb
> for a in `ls / | grep -v proc | grep -v dev `;do \
> find /$a >>/tmp/locatedb;done
> mv /tmp/locatedb /var/locatedb
With debian and a real find u can use:
find / -xdev
So update would become to
find / -xdev > /var/locatedb
But to minimize update what about to delete the two greps
for a in `ls -d /* | sed 's/\/proc\|\/dev//'` do ...
To only one sed
Normally find understands someting like
fine /path1 /path2 ...
Hope that word also under mu so we can drop the for...
find `./ls -d /* | ./sed 's/\/proc\|\/dev//'` > /var/locatedb
But nice doing :)
Jochen
---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.auc.dk
For additional commands, e-mail: mulinux-help@sunsite.auc.dk
This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:16 CET