Results 1 to 2 of 2

Thread: updation of locate database

  1. #1
    Join Date
    Jun 2007
    Location
    India
    Beans
    43
    Distro
    Ubuntu 7.04 Feisty Fawn

    updation of locate database

    1) When does the database of locate command gets updated?
    2) Do I ever need to change the update time of database?
    3) If yes, the how?
    4) Why do I need a find command when I can search things faster with locate command? Is there any other benefit of find command?
    I have a fine sense of the ridiculous, but no sense of humor.

  2. #2
    Join Date
    Oct 2006
    Location
    Belgrade, Serbia
    Beans
    1,321
    Distro
    Ubuntu

    Re: updation of locate database

    1-3.
    Code:
    man locate
    DESCRIPTION
    locate reads one or more databases prepared by updatedb( 8 ) and writes file names matching at least one of the PATTERNs to standard output, one per line.
    Code:
    man updatedb
    DESCRIPTION
    updatedb creates or updates a database used by locate(1). If the database already exists, its data is reused to avoid rereading directories that have not changed.
    updatedb is usually run daily by cron( 8 ) to update the default database.
    So to update it, all you have to do is:
    Code:
    sudo updatedb
    4. I don't know if it's faster than locate, but find can help you find something specific in a specific directory, recursive or not (-depth) and so on..
    To see how to use it you'll have to read the manual with the list of command arguments/operators:
    Code:
    man find

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •