That wouldn't make much sense. If you would store all the options find can test files against in a database you would have to update that database constantly. find is able to find files that were last accessed n minutes ago with the -amin option. In fact, every time a file is accessed, created, deleted or changed, you would have to update the database. That is very resource-consuming, if not even practically impossible.
|
Exactly; whatever tool you use, it first has to search for the info. With 'find' it does it in real time and is very flexible. With updatedb, this is normally run in cron at eg 4am and only stores filenames/locations.
Other search options are http://linux.die.net/man/1/which & http://linux.die.net/man/1/whereis. They all have different expectations & limitations. See the old quote about 'use the right tool for the job'. Best thing is to read up on all 4 options/cmds and decide when you'll use each one. |
Thanks everybody!
|
Locate vs Find
I work as a Linux Systems Admin, so i use both very often.
When i know the filname or some part of it, and need to know where on the FileSystem something is, I use locate. Its very fast, low resources is important on those over-shared systems. When i need to get a list of files to do commands on, often when the parameter is not filname related, i use find. I use this very often to change permissions. Code:
#for just the directories from ./,# if i want execute on something with a file extension (such as txt), i would not use find -name unless nessesary for multi-level directories. Code:
#I prefer the much faster,# so they actually serve very diffrent purposes for me. i end up using locate much more often, a quick Code:
#or if i need to remove unrelated listings Hope this helps, |
Quote:
|
All times are GMT -5. The time now is 10:10 PM. |