Download your favorite Linux distribution at LQ ISO.
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 06-08-2004, 02:35 AM   #1
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Rep: Reputation: 30
updatedb every time?

Whenever I have to locate files (created recently) I have to "updatedb". It gets very boring, and I have to locate files quite often. Is there any other way to look for files? Or any better method?
Old 06-08-2004, 03:13 AM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
updatedb should run as a cron job. Go to your /etc/cron.daily directory and see if there's a script in there that runs updatedb. If not, you can create one by creating a new file (name is not important, but call it something descriptive -- it's called slocate on my Slackware 9.1 system) with the following contents:


/usr/bin/updatedb -c
You'll need to change the location of updatedb if it is not located in /usr/bin on your system (it usually is -- type which updatedb to be sure). If this file already exists, probably cron is not running -- it should be started out of Slackware's /etc/rc.d/rc.M file -- make sure the line with crond is uncommented.

If you want to search for files that were created between the last updatedb time and the present, you'll want to use the find command. It has massive numbers of options, but the general form to find a file by name is:

find <directory> -name <name>

which starts a recursive search in <directory> looking for files of name <name>. If you want to use wildcards in the name, you'll have to put it in quotes.
Old 06-08-2004, 04:37 AM   #3
LQ Guru
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
'find' should be alright if you're able to narrow down the location of the file you want to search to a certain extent.
Old 06-08-2004, 12:35 PM   #4
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Original Poster
Rep: Reputation: 30
Thanks btmiller & Demonbane. Updatedb is running as a cron job. "Find" is a good option. Thanks for the help


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
Why Do I need to run updatedb each time I search for a file or folder? lennysokol Linux - Software 4 05-30-2005 11:49 PM
What's the difference between 'updatedb' and 'updatedb&' ?? DreameR-X Linux - Newbie 4 12-18-2004 05:36 PM
updatedb? nexx_au Fedora 2 04-06-2004 11:17 PM
updatedb pezplaya Fedora 2 01-05-2004 06:32 PM
Updatedb & time Option mikeshn Linux - General 1 06-12-2003 12:09 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:48 AM.

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