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?
|
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 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. |
'find' should be alright if you're able to narrow down the location of the file you want to search to a certain extent.
|
Thanks btmiller & Demonbane. Updatedb is running as a cron job. "Find" is a good option. Thanks for the help
|
All times are GMT -5. The time now is 10:47 PM. |