Why updatedb command takes too much time

cygwin;locateupdatedb

I have read that to run locate command on CYGWIN first I need to run the following command.

updatedb --localpaths=c:/

what this command exactly do as I run this on CYGWIN and it is taking too much time.

Best Answer

This updates the locate database, which will indeed take a long time. It has to traverse every path on the system and then index it appropriately, which requires a lot of work (and a lot of resources).

While it's not really possible to speed up population of the database, you can make it less intrusive by increasing the niceness and io-niceness of updatedb. You can do this by using the nice and ionice utilities, in a manner similar to the following:

nice -n 19 ionice -c 3 updatedb --localpaths=c:/