-1

First. Yes I have been searching for a related posting but am not having any luck so I'm resorting to this post now. I'm deploying code to our Red Hat Linux box and am trying to find the right folder to deploy to. The code needs to go into the Tomcat webapps directory but I'm finding many of them using the locate feature. I'm not familiar with our environment and we have nobody who is familiar with it. I'm pretty much the designated SME. So, I am thinking that in RH Linux it is caching folders and files that use to be there and that cache is being searched. I'm not able to deploy to the correct directory yet as I'm trying to find where to put the code.

Can someone explain how on Red Hat to locate the files and folders that do exists so I can get this code pushed up to the correct location? I'm also trying to clean up the server that has way too many copies of copies and backups. I have been using the locate -b SOMENAME to find particular folders. Some of the items that are listed in the output from the above command when I try to navigate yields a No such file or directory response.

Is there something that needs to be cleared out of some memory or indexing file that is being searched? And if so please post the command.

What causes this scenario to occur?

edjm
  • 4,830
  • 7
  • 36
  • 65

1 Answers1

2

locate does not search the file system but uses a prepared "snapshot" created by updatedb, which may typically run in some nightly cron job. If a file has been deleted after last time updatedb was run, you will observe this behaviour.

Try locate -e -b SOMENAME instead, this will make locate check that the file actually exists before reporting a match.

Bjorn Munch
  • 496
  • 2
  • 6
  • Thank you very much. This is EXACTLY the information that I wanted to know! @BjornMunch – edjm May 08 '15 at 10:13