`

linux locate - find files by name

阅读更多
【基本介绍】
这里我们介绍locate命令,用来查找文件。

【安装配置】
安装mlocate
yum install mlocate

生成db数据文件
[root@root ~]# updatedb 
[root@root ~]# ls /var/lib/mlocate/mlocate.db 
 /var/lib/mlocate/mlocate.db

用locate进行查找
[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
分享到:
评论

相关推荐

    linux-command-line

    - **find /dir/ -name name***:在指定目录`/dir/`下查找所有以`name`开头的文件。 - **find /dir/ -user name**:在指定目录`/dir/`下查找所有属于用户`name`的文件。 - **find /dir/ -mmin -num**:在指定目录`/...

    Linux所有命令汇集

    locate (Locate files by name using a pre-built database)** `locate` 命令通过预先构建的数据库来快速查找文件。这比使用 `find` 命令更快,因为它不需要实时扫描文件系统。 **19. lsattr (List file ...

    linux.chm文档

    find /home/user1 -name \*.bin 在目录 '/ home/user1' 中搜索带有'.bin' 结尾的文件 find /usr/bin -type f -atime +100 搜索在过去100天内未被使用过的执行文件 find /usr/bin -type f -mtime -10 搜索在10天内...

    运维常用linux

    - **命令**: `find /etc -name "passwd*" -exec grep "xuesong" {} \;` - 示例: `find /etc -name "passwd*" -exec grep "xuesong" {} \;` **14. 查找文件名,不取路径** - **命令**: `find . -name 't*' -exec ...

    linux的一些命令嵌入式

    - **示例**: `find /path -name "filename"` - **命令**: `locate` - **功能**: 快速查找文件。 - **示例**: `locate filename` #### 7. 基础网络命令 (Basic Networking Commands) - **命令**: `ping` - **...

    linux实用笔记 包括U盘实用

    - `find / -name "passwd"` 在根目录下查找名为 `passwd` 的文件; - `locate filename` 快速定位文件位置。 **4. 其他常用命令:** - `df` 命令用于查看磁盘空间使用情况。 - `du` 命令用于估算文件或目录所占的...

    Linux常用命令大全及示例-超全.pdf

    find /home/user -name "*.txt" # 在/home/user目录下查找所有扩展名为.txt的文件 find /path/to/dir -type d # 在指定目录下查找所有目录 ``` ##### 20. **locate命令** —— 快速查找文件或目录 - **功能**:...

    python 整合linux命令搜索

    这篇博文(虽然描述为空,但我们可以根据标题推测内容)可能探讨了如何利用Python编写脚本来调用和集成Linux的搜索命令,如`find`, `grep`, `locate`等。这些命令在日常开发和系统管理中非常常用,能够帮助我们快速...

    Linux常用命令经典版本

    `locate`命令快速查找文件路径,通常比`find`命令更快。 - **更新数据库**:`updatedb`。 - **查找文件**:`locate filename`。 #### 19. tar `tar`命令用于打包和解包文件,常用于备份和压缩。 - **打包文件**:...

    Linux系统常用操作命令大全手册

    ### Linux系统常用操作命令大全手册知识点详解 #### 文件管理 - **`ls`**:用于显示当前目录下的文件和子目录列表。 - **`ls -l`**:以长格式显示文件详细信息,如权限、链接数、拥有者、大小等。 - **`ls -a`**:...

    关于linux日常使用的shell命令

    - 示例:`find /etc -name "*.conf"`,这里将在 /etc 目录下查找所有扩展名为 .conf 的文件。 10. **ln**:创建硬链接或符号链接。 - 示例:`ln -s target linkname`,其中 `-s` 表示创建符号链接。 11. **...

    Linux架构下本地文件快速搜索工具设计与实现.pdf

    在Linux操作系统环境下,虽然有多种文件查找方法,如文件管理器、`find`命令和`locate`命令,但在面对大量文件时,这些方法往往无法满足快速、准确的搜索需求。因此,设计并实现一个轻量级的本地文件快速搜索工具...

    Wiley.Publishing.Fedora.Linux.Toolbox.1000+.Commands.for.Fedora.CentOS.and.Red.Hat.Power.Users.and.Red.Hat.Power.Users.2008.pdf

    - **Finding Files**: Searching for files based on name, type, size, and other criteria using `find`, `locate`, and `grep`. #### Chapter 5: Manipulating Text Text manipulation is a powerful feature in...

    ehlib_vcl_src_9_3.26

    and name sum field (goCount name of field is unnecessary). TPrintDBGridEh component TPrintDBGridEh provides properties and routines for preview and print of TDBGridEh component with several ...

    运维常用linux命令shell技巧范例

    - 示例:`find /etc -name "http*"` - 在`/etc`目录下查找名称以`http`开头的文件。 2. **locate**:快速查找文件路径。 - 示例:`locate filename` - 快速查找文件`filename`的路径。 3. **wc**:统计文件的...

    EhLib 9.1.024

    and name sum field (goCount name of field is unnecessary). TPrintDBGridEh component TPrintDBGridEh provides properties and routines for preview and print of TDBGridEh component with several ...

    grub4dos-V0.4.6a-2017-02-04更新

    已经发现的问题是执行 find,不返回 (hd0);精简 PE 加载映像文件死机。 2.解决了FDD 模式的 u 盘,执行 find 时返回 (fd0,n) 的问题。 3.修正了 menu.lst 中 0PE.ISO 的默认位置。 4.usb2.0 驱动通过菜单或...

    shell cheat sheet

    - **Find Files**: Use `find` to locate files based on various criteria. For example, `find . -type f -size +10k` finds all files larger than 10 KB in the current directory and its subdirectories. - **...

    linux考试题答案.docx

    - `find`: 根据指定条件查找文件,如`find /etc -name "sh*"`查找/etc目录下以"sh"开头的文件。 4. **vim编辑器**: - `vim`: Linux下的文本编辑器,用于创建、编辑和修改文件。 - `:set nu`: 在vim中显示行号,...

Global site tag (gtag.js) - Google Analytics