Linux (Unix) locate command for windows and dos commad line. Installation, setup and usage

By neokrates, written on December 11, 2010

howto

  • Join date: 11-30-99
  • Posts: 224
View Counter:
  • 466 views
Rate it
Ad
Poll
  • What build management tool does your project or firm use?

    View Results

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext

What I want is to be able to type “locate startup.bat” and know where is my apache, type “locate jdk*” and learn about installed java versions.
I won’t it instantly, and that is what windows can’t do. With the “locate32” I get the same power of “linux locate” and a nice GUI, which can replace windows search.

Nice thing is also that I can script using “locate”.

Woks for:

✔ windows XP

Should also work for:

✔ most windows versions

What is locate32


Locate32 is both command line and GUI implementation of Linux or Unix locate command. Hence IT DOESN’T WORK ON LIVE DATA of you PC.

It first creates the index of all what you have and then finds what you want from that index. Considering that most things you search for, are there for days, that is absolutely ok.

1

Installation

Here you can get the latest beta. In my case the release was too old and I tried one of the betas. It worked like charm:
http://locate32.net/files/betas/

You can also try daily:
http://locate32.net/files/daily/

If you want current latest stable, go
http://locate32.net/ and then downloads.

Download and unzip in the directory you want it to be. The zip version seems to be portable. You can relocate directory whenever you want, it preserves the state. No dll’s, no .reg entries.

2

Setup

2.1

Command line

Set up your environment variables. You can set either User variables or system, both will do.
Given your path is now %PATH%;C:\WINDOWS\system32, after you edit it should be:

%PATH%;C:\WINDOWS\system32;C:\path\to\locate\dir

Now start dos command line and type locate myfile.txt. It should produce no error.

2.2

Gui

Needs no setup. Just start C:\path\to\locate\dir\locate32.exe

2.3

Create index

Be aware, that indexing databases may take hours. Best time to do it is during the night, that can be scheduled.
To use locate you need updated database. If you are ok that your system would be slowed down for some time, start and update. If not, you can proceed later.

In gui select File -> Update Databases.

If asked what to index, select local drives and avoid network devices. During update you will see the “working” symbol in the windows task list.

👉 You can also setup, how much resources the indexer is to consume: tools -> settings -> ["Scheduled Updates" tab] Edit or Add, then tune resource consumption rules.

3

Test it

You can now test locate and check output:

>locate locate.exe
C:\path\to\locate\dir\locate.exe

 

Optional: schedule daily index

That should be ensured locate knows about new files.

  • Go tools -> settings -> ["Scheduled Updates" tab]
  • "Add" Button
  • I would suggest you select time when you are away from keyboard, like 23:55, every day

 

4

Using locate

For Linux and UNIX user, that’s pretty much the same. For those new to locate, some basics:

4.1

Use from command line

You can locate single files:

>locate myfile.ext

 
Or use wildcards (? or *):

>locate myfile.*

 

Or use file list

>locate myfile.*, yourfile.txt

 

Also, locate can user perl regular expressions. I couldn’t get it to work on command line, but GUI did it just fine

4.2

Use gui

The same as command line can be done with gui.
Here are some things which definitely work:

  • Search for some files:
[Name & Location TAB] -> Named = startup|shutdown
  • By size and by date:
[Size and Date TAB]
Maximum/minimum size, newer or older criteria
  • By content:
[“Advanced” TAB] -> “File containing text”
Maximum/minimum size, newer or older criteria

👉 The content search is much slower as there is no index for file content.

5

Advanced use cases

Replace windows search

Can be done on Vista and Win 7. Refer to the Help topic built in the tool, chapter ” Setup … as default search application”

System thumbnail & audition. Watch daily file system modifications

Running daily locate you can get the thumbnail of all the system files.
Then, archive the current state of the database.
You can find the database settings in tools -> settings -> ["Databases" tab] and view your current used databases in dialog “database Options”.

Setup archiving current state after the run of locate utility.
Then, if you run into system problems or just wish a little retrospective, you can use the older database state.
I also presume that the *.dbs format can be read by some database viewer, that will make system audition absolutely flexible and programmable task.

More info & questions
Forum seems to be helpful:
http://locate32.net/forum/

Be Sociable, Share!
 
Does that help to solve your problem?
VN:F [1.8.5_1061]
Rating: 0 (from 0 votes)
0 votes 'YES'  0 votes 'NO'


TAGS

SOCIAL
Be Sociable, Share!

INCOMING SEARCH TERMS


3 Responses to “Linux (Unix) locate command for windows and dos commad line. Installation, setup and usage”

  1. […] reszt? artyku?u: Linux (Unix) locate command for windows and dos commad line … and-know, and-learn, apache, java-versions-, type-locate This entry was posted on gru 12th, […]

  2. […] URL: Linux (Unix) locate command for windows and dos commad line … and-know, and-learn, apache, java-versions-, […]

  3. Cledson says:

    Many, many,many thanks.
    Perfect.

Leave a Reply