
find [搜索范围] [选项]
/home目录下的 hello.txt 文件find /home -name hello.txt/opt目录下,用户名称为nobody的文件find /opt -user nobodyfind / -size +200Mlocate 搜索文件updatedb指令创建locate数据库。locate指令快速定位hello.txt文件所在目录,找不到就不返回数据locate hell.txtwhich Is

|”,表示将前一个命令的处理结果输出传递给后面的命令处理。grep [选项] 查找内容 源文件
hello.txt文件中,查找"yes"所在行,并且显示行写法1:
cat /home/hello.txt | grep -n "yes"写法2:
grep -n "yes" /home/hello.txt