# updating whereis results



## z662 (Apr 23, 2009)

Hello, I recently just installed openoffice.org via a precompiled package on line. I installed it by dumping the scripts into /usr/local/bin and it works fine when running it from the command line. My question is how to get it to be added to the whereis results, if possible. I tried to find on line how the whereis program works and what files/databases it uses but I was unable to find anything regarding it. Obviously I know where the program resides, I am asking this question just to get a better understanding of the FreeBSD internals and how the system works. Thanks a lot!


----------



## Gkarfield (Apr 23, 2009)

try "find", its somewhere in /usr/local  i suppose.


----------



## Gkarfield (Apr 23, 2009)

sorry i diid not read carefully what  you wrote, but i think  that you did not also read the man page of 'whereis" [i just took a fast look now]


----------



## tangram (Apr 23, 2009)

man whereis


----------



## SeanC (Apr 23, 2009)

When whereis(1) can't find what you are looking for, it passes the job to locate(1). But, locate(1) is updated by a weekly script and may not show up yet.


----------



## SirDice (Apr 23, 2009)

z662 said:
			
		

> Hello, I recently just installed openoffice.org via a precompiled package on line. I installed it by dumping the scripts into /usr/local/bin {...}


:O

Chapter 4 Installing Applications: Packages and Ports

editors/openoffice.org-3



> I tried to find on line how the whereis program works and what files/databases it uses but I was unable to find anything regarding it.


See whereis(1).


----------



## edhunter (Apr 23, 2009)

`$ /usr/libexec/locate.updatedb`

this should update locate database


----------



## phoenix (Apr 23, 2009)

Alternatively, you can run the periodic(8) script that gets run every week, so that it updates things in the same manner:  */etc/periodic/weekly/310.locate*  That just runs locate.updatedb in the background.


----------



## fronclynne (Apr 23, 2009)

*At least in the context of multiuser systems*



			
				phoenix said:
			
		

> Alternatively, you can run the periodic(8) script that gets run every week, so that it updates things in the same manner:  /etc/periodic/weekly/310.locate  That just runs locate.updatedb in the background.


It also builds the database as "nobody", which might be slightly more secure than just running locate.updatedb as root.


----------



## z662 (Apr 26, 2009)

Ok thanks for all of your input. Now I have another question, whereis will only return the location if i specify the entire name of the program (including version number) e.g whereis openoffice.org-3.0.0   Is there any way that I can make whereis return the location by just simply typing whereis openoffice.org. I only care about this in case in the future I update it or have a similar issue with another package


----------



## fronclynne (Apr 26, 2009)

[cmd=>]find /usr/local/ -type f -perm +o+x -iname "*openoffice*"[/cmd]


----------



## phoenix (Apr 27, 2009)

Use *locate*.  It queries the same database as *whereis*, but it does a wildcard search (*locate <query>* will return all paths with <query> in them).  Then pipe it through grep to narrow it down.  *locate openoffice | grep bin*


----------

