locate: can not open
Running into a problem with the locate command. When I try to use the locate command: locate *.h
I get the following error message: locate: can not open `/var/lib/mlocate/mlocate.db': No such file or directory I have a lot of include files in /usr/include and I locate responds to whereis. Does anyone know whats happening? Any help would be appreciated. Ron |
Try running the updatedb command as root.
If you're using ubuntu or any of its derivatives, type sudo updatedb Note: You need to run this command when you add new files and/or programs to your linux system. This step is optional. But it must be run the first time before using the locate command. When the updatedb finished, try the locate again. Tip: Add the -i option to locate for case insensitive search. locate -i keyword |
Quote:
# updatedb (as root) (if you have problems locating something you know exists) Then: $ locate "*.h" Note the quotes -- this will prevent shell expansion of your argument, so "locate" sees it as you intended regardless of the content of the current directory. |
All times are GMT -5. The time now is 10:24 AM. |