Search code examples
wildcardrmlocate

Why rm does not delete files?


I issue the following command:

Input:  locate libboost
Output: /usr/lib64/libboost_wserialization-mt.so
        /usr/lib64/libboost_wserialization-mt.so.1.53.0
        /usr/lib64/libboost_wserialization.so
        /usr/lib64/libboost_wserialization.so.1.53.0

Then I navigate to /user/lib64 and issue the command rm -f libboost*. However, when I issue locate libboost again, I still the the same output that is printed above. Why libboost files are not deleted?


Solution

  • The locate command does not reflect the current status. It refers to a database, which is updated from time to time. You can trigger the update with the command updatedb. After the update, locate will not display these files anymore.