I'm a bit new to unix/linux environment, but I have a small problem.
I'm using "locate" to find the path of a file I need, it gives me the path for it, but the file doesn't exist in that path, like that:
locate test1.txt
/home/user/test files/text1.txt
/home/user/test1.txt~
"test files" directory is where I was keeping the file and I copied it to the home directory once but I deleted it, no idea what it keeps telling me there is still a tmp file for it.
it worth mentioning that I used the command:
locate test1.txt~ |xargs -n1 rm
to remove that tmp file, but maybe that what caused the problem. I tried to show hidden files, and check for temp files, didn't find it either.
any clue what happened?
locate
uses a database that is only updated periodically (e.g. every 24 hours) so it's quite possible for the database and reality to be out of sync.find
instead oflocate
(personal opinion alert -locate
is the result of some misguided "we need to do things the same way Microsoft does" thinking).locate
dates from 1983. That is two years before the first windows version was released.