---
title: "linux locate - find files by name"
author: "飞奔的熊猫"
date: "2014-12-17T17:46:32Z"
tags: []
categories: ["开源软件"]
slug: "linux-locate-find-files-by-name"
draft: false
lastmod: "2014-12-18T15:05:23Z"
id: 2167145
url: "https://runpanda.iteye.com/blog/2167145"
---

【基本介绍】
这里我们介绍locate命令，用来查找文件。

【安装配置】
安装mlocate

```linux

yum install mlocate

```

生成db数据文件

```linux

[root@root ~]# updatedb 
[root@root ~]# ls /var/lib/mlocate/mlocate.db 
 /var/lib/mlocate/mlocate.db

```

用locate进行查找

```linux

[root@root tmp]# locate 6385.conf
/etc/redis/6385.conf

```



【参考引用】
<https://www.digitalocean.com/community/tutorials/how-to-use-find-and-locate-to-search-for-files-on-a-linux-vps>