大网数据广告活动
服务器运维问答

locate returns no results on Ubuntu

· 52CE 我爱测

When I search for something simple such as locate php.ini or locate my.cnf I get no results. This works as expected on one of my Ubuntu 14.04 boxes but not on the other. Do I need to change an indexing setting?

问题原文

原帖链接 · eComEvo · CC BY-SA 3.0

When I search for something simple such as locate php.ini or locate my.cnf I get no results.

This works as expected on one of my Ubuntu 14.04 boxes but not on the other. Do I need to change an indexing setting?

已采纳解答

原帖链接 · Nasir Riley · CC BY-SA 3.0

Look into your /etc/updatedb.conf and check that the filenames that you are searching for or the directory locations are not in the PRUNE settings.

Also, if the files are fairly new, try the following command:

updatedb

Make sure that you are running as root.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-01-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。