Koozali.org: home of the SME Server

LOCATE command

Carl Fearby

LOCATE command
« on: August 06, 2002, 01:33:53 PM »
there dont seem to be a locate command on SME does anyone know how to install this and if so where to get it from, also a howto would be excellent


Cheers

Mike O'Leary

Re: LOCATE command
« Reply #1 on: August 06, 2002, 04:07:52 PM »
I was shocked to find that there was not a locate command in this version of e-smith, however I did find out that there is something like it, and it is quite good.

Its called find

to fiind a document

find / -name '*name*' -print

Its simple to use

find [in what directory, eg /, /var, /etc, it is basically the start directory and it will search all subdirectories] -name [what file, or files, eg '*squid*' will find squid.conf and other items dealling with squid] -print

Hope this may help

Dan Brown

Re: LOCATE command
« Reply #2 on: August 06, 2002, 04:21:09 PM »
slocate ships on the CD, but isn't installed by default.  I don't agree with this decision, but it isn't intended that you'll be using the command line on the server at all, so I suppose it isn't really a problem.

find works and is more up-to-date, but it's slower and more of a pain syntax-wise.  Locate is much simpler in syntax and faster (since it queries a database rather than searching the whole filesystem), but it isn't quite as up-to-date (since the database is updated daily).

Z3rO

Re: LOCATE command
« Reply #3 on: August 06, 2002, 04:21:34 PM »
There IS a locate command! But you have to run the updatedb command at first.
Simply type in "updatedb" (Without quotes) into the server console. Then try with something like "locate apache"

Regards

Z3rO

Carl Fearby

Re: LOCATE command
« Reply #4 on: August 06, 2002, 04:33:28 PM »
[root@server /root]# updatedb
bash: updatedb: command not found
[root@server /root]# locate
bash: locate: command not found
[root@server /root]#


that dont work Z3rO wrote:
>
> There IS a locate command! But you have to run the updatedb
> command at first.
> Simply type in "updatedb" (Without quotes) into the server
> console. Then try with something like "locate apache"
>
> Regards
>
> Z3rO

Charlie Brady

Re: LOCATE command
« Reply #5 on: August 06, 2002, 06:07:28 PM »
Dan Brown wrote:
>
> slocate ships on the CD, but isn't installed by default.

It is installed by default in version 5.5. The reason that it wasn't by default in earlier versions was due to the number of users reporting concern at the middle-of-the-night disk activity while the index was updated. But convenience has won out, and it's back as a standard feature. If anyone doesn't want the extra activity, they can "rpm -e slocate".

Regards

Charlie

Dan Brown

Re: LOCATE command
« Reply #6 on: August 06, 2002, 06:17:22 PM »
OK, thanks for the update, Charlie.  It was on my test 5.5 box, but I've tinkered around with that one enough that I didn't remember if it was there by default.