#头条创作挑战赛#
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[选项] 查找内容 源文件
常用选项
-n 显示匹配行及行号
-i 忽略字母大小写
案例:
cat hello.txt | grep -n haha
cat hello.txt | grep -ni haha
页面更新:2024-05-11
本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828
© CopyRight 2020-2024 All Rights Reserved. Powered By 71396.com 闽ICP备11008920号-4
闽公网安备35020302034903号