[Ilugc] LOCATE files

  • From: l.mohanphy@xxxxxxxxx (Mohan L)
  • Date: Mon, 30 Dec 2013 17:47:51 +0530

On Mon, Dec 30, 2013 at 5:14 PM, Ranjith Kumar <ranjithrhc at gmail.com> wrote:

Hi,

You can also use: # ll `locate file-name` | grep user | awk '{print $9}'


Hi Ravi Chandran,

In addition to the above one line.
Please be aware that
 
locate does not search the files on disk rather it searches for file paths
in a database. The locate database file is located at
"/var/lib/mlocate/mlocate.db". Hence, in order to get the latest and
reliable results from "locate" command the database on which it works
should be updated at regular intervals using another utility known as
"updatedb".

Thanks
Mohan L



Other related posts: