#头条创作挑战赛# 1.find指令 基本语法: find [搜索范围] [选项] 选项说明: -name<> 按照指定的文件名查找模式查找文件 -user<用户名> 查找属于指定用户名所有文件 -size<文件大小> 按照指定的文件大小查找文件 案例: find /home -name hello.txt find /opt -user nobody find / -size +20M(-20M 20M) 2.locate指令 基本语法: locate 搜索文件 注意: 第一次运行前,必须updatedb指令创建locate数据库 案例: 使用locate快速定位hello.txt:locate hello.txt 3.grep指令和管道符号 | grep过滤查找,管道符|表示将前一个命令的处理结果输出传递给后面的命令处理 基本语法: grep[选项] 查找内容 源文件 常用选项 -n 显示匹配行及行号 -i 忽略字母大小写 案例: cat hello.txt | grep -n haha cat hello.txt | grep -ni haha