Funny grep under Debian

Recently I played with Plutohome which is based on Debian I found some strange thing with grep. When I tried to find the word ‘pluto’ in the directory /etc/init.d:
grep -i pluto /etc/init.d/* -n
I was very surprised when I saw error messages about missing files in this directory. It seems that grep under Debian uses locate to retrieve a list of files for specified directory. Maybe it isn’t a common case. It looks strange because the indexes for command locate are updated once at night. Some new files which are not indexed yet won’t be in the grep input and result won’t be correct.

Published by

Michael Stepanov

Site owner and admin :)

Leave a Reply

Your email address will not be published. Required fields are marked *