LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
LinkBack Search this Thread
Old 06-08-2004, 01:35 AM   #1
akudewan
Member
 
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, 02:13 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 3,988

Rep: Reputation: 261Reputation: 261Reputation: 261
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:

Code:
#!/bin/sh

/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, 03:37 AM   #3
Demonbane
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, 11:35 AM   #4
akudewan
Member
 
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
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are 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 10:49 PM
What's the difference between 'updatedb' and 'updatedb&' ?? DreameR-X Linux - Newbie 4 12-18-2004 04:36 PM
updatedb? nexx_au Fedora 2 04-06-2004 10:17 PM
updatedb pezplaya Fedora 2 01-05-2004 05:32 PM
Updatedb & time Option mikeshn Linux - General 1 06-11-2003 11:09 PM


All times are GMT -5. The time now is 07:41 PM.

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