Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-01-2009, 11:25 PM   #1
Registered: Oct 2005
Location: Bangladesh
Posts: 490

Rep: Reputation: 30
about updatedb command

Dear Friends ,

We are using "updatedb" command before running 'locate' and 'find' command .

Now would anybody plz tell me , what s the function of 'updatedb' and is there any database in linux platform ?

plz explai briefly .. ...

thx in advancne ... ...
Old 10-01-2009, 11:37 PM   #2
Registered: Nov 2008
Location: ~/
Distribution: Arch || Sidux
Posts: 393

Rep: Reputation: 45
man updatedb

Also google is your friend
Old 10-01-2009, 11:40 PM   #3
Senior Member
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
It's not necessary with the find command, as that performs actual directory traversal. You should have updatedb run automatically each day on most Linux systems (and Unix, for that matter, I'd think) and it's to keep the locate database in sync with filesystem reality. On my system, the db is /var/lib/slocate/slocate.db. But, if you've just added a lot of files and want to 'locate' them, then you'd need to manually updatedb before the scheduled job. Is that what you were asking?
Old 10-01-2009, 11:40 PM   #4
Registered: Dec 2008
Location: Herrera
Distribution: Debian GNU/Linux 5.0
Posts: 74

Rep: Reputation: 15
Hi, the updatedb command works to update the database that were in particular directory trees when the databases were last updated.

It's is use to , for example you want to find something but maybe it was create just seconds ago, you wont find it, coz the system has not updated its database so you type updatedb to do so.

i hope this help..
Old 10-02-2009, 04:00 AM   #5
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Updatedb is mostly meant to find system files, that shouldn't change all that much except when you upgrade packages. It's usually run via the cron daemon once a day.

If you find yourself doing "updatedb && locate <whatever>" then it's time for you to learn to use "find".

The updatedb database is usually somewhere under /var/lib, but the concrete place depends on the implementation of locate that you use. There are several of them, like slocate and mlocate. So, as said above, check the man page. There's nothing obscure on it really.
Old 10-02-2009, 04:42 AM   #6
Mr. ameya sathe
Registered: Jul 2007
Distribution: RedHat Enterprise 5 Server Edition; Ubuntu 8.04 ; RHCE Certificate number: 805008741034103
Posts: 78
Blog Entries: 8

Rep: Reputation: Disabled
Also; if you delete loads of files in a day, then you need to run the updatedb command.
Old 10-02-2009, 12:22 PM   #7
Registered: Oct 2005
Location: Bangladesh
Posts: 490

Original Poster
Rep: Reputation: 30
Thx all


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
updatedb crashes: src/updatedb.c:730: scan_cwd: Assertion `name_size > 1' failed sumanc Fedora 3 07-11-2008 05:39 PM
What's the difference between 'updatedb' and 'updatedb&' ?? DreameR-X Linux - Newbie 4 12-18-2004 05:36 PM
updatedb mikedeatworld Linux - Software 21 09-16-2004 11:59 PM
updatedb? nexx_au Fedora 2 04-06-2004 11:17 PM
updatedb pezplaya Fedora 2 01-05-2004 06:32 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:15 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration