|
locate a file
|
|
12-19-2009, 09:07 PM
Post: #1
|
|||
|
|||
|
locate a file
This command lets you locate a file without scanning directories.
Code: locate your_file_name |
|||
|
12-19-2009, 09:20 PM
Post: #2
|
|||
|
|||
|
RE: locate a file
Does it basically search whole Hard Disc to find the file or ???
There's a fine line between genius and insanity. I have erased this line. Oscar Levant There's a fine line between an administrator and black hat hacker. I have erased this line. Dr DEBCOL |
|||
|
12-19-2009, 09:31 PM
Post: #3
|
|||
|
|||
RE: locate a file
(12-19-2009 09:20 PM)drdebcol Wrote: Does it basically search whole Hard Disc to find the file or ??? Unix system keep track of every file created and placed on the system already. So every file you have on the system is in a database. So it just simply locates it in the database ![]() you can use the find command to scan the harddrive
|
|||
|
12-19-2009, 09:32 PM
Post: #4
|
|||
|
|||
|
RE: locate a file
That sounds great. That is reliable !
There's a fine line between genius and insanity. I have erased this line. Oscar Levant There's a fine line between an administrator and black hat hacker. I have erased this line. Dr DEBCOL |
|||
|
12-19-2009, 09:39 PM
Post: #5
|
|||
|
|||
|
RE: locate a file
yea pretty much instant
|
|||
|
01-18-2010, 09:20 PM
Post: #6
|
|||
|
|||
|
RE: locate a file
The indexes get updated by the updatedb command, so if updatedb hasn't ran since last time there's a new file you are looking for, the find command could be quicker. If you look in /etc/cron.daily on Ubuntu, you will see a script that runs daily only if the computer is not running on battery power. And with /etc/crontab, you can see that scripts in /etc/cron.daily run at 4:17pm each day by default.
1 # /etc/crontab: system-wide crontab 2 # Unlike any other crontab you don't have to run the `crontab' 3 # command to install the new version when you edit this file 4 # and files in /etc/cron.d. These files also have username fields, 5 # that none of the other crontabs do. 6 7 SHELL=/bin/sh 8 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 9 10 # m h dom mon dow user command 11 17 * * * * root cd / && run-parts --report /etc/cron.hourly 12 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 13 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 14 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) 15 # 16 17 |
|||
|
12-15-2010, 07:44 AM
Post: #7
|
|||
|
|||
|
RE: locate a file
@drdebcol
It searches everything that's not blacklisted in /etc/updatedb.conf So edit that file if you want to search in more locations. But the locate command won't find anything thats newer than the last time updatedb was ran. updatedb runs automatically on intervals by cron, but you can run it manually too. locate doesn't have nearly as many features as the find command. Use -i to ignore case. |
|||
|
02-17-2011, 05:41 PM
Post: #8
|
|||
|
|||
|
RE: locate a file
any kind of file? unless if the filename is incorrect right?
|
|||
|
02-18-2011, 03:45 PM
Post: #9
|
|||
|
|||
| RE: locate a file | |||
|
« Next Oldest | Next Newest »
|






