A file shows in "locate" command but don't exist. Why?
I'm having a strange issue.
I am currently fixing a flash install on Backtrack 5 (Based on Ubuntu). I really need to get flash to work, so I looked up on Google. On some board, one guy said that on this distribution (which is finally based on Debian) flash installs into Iceweasel-flashplugin, so we need to change the path to there from Iceweasel to Firefox. (Or tell Firefox to look for the plugin down there, I'm not sure).
But Here comes the weird part. When using the locate command, I can find some file and the path to it. Trying the cat command on this exact path gives "no file or directory", and even with ls -la nothing comes. I have only two files beginning with i's.
Does someone know why this is happening? And would there be a way to fix this flash install?
Shell screenshot:
Solution 1:
locate
uses a database called locatedb
. It's normally updated by system cron jobs. If the DB hasn't been updated, it'll show non-existent or new files/directories. you can force an update with the updatedb
command. See this link among others.
Manpage of locate
clearly says -
locate reads one or more databases prepared by updatedb and writes
file names matching at least one of the PATTERNs to standard output,
one per line.
By default, locate does not check whether files found in database still
exist; locate can never report files created after the most recent
update of the relevant database.
Source
Solution 2:
locate is based on a database which is usually updated once a day via cron.
Force an update: run updatedb
and your locate iceweasel
will return up-to-date results.