在当前目录下查找查找包含指定内容的文件

来源:互联网 发布:尼采知乎 编辑:程序博客网 时间:2024/06/05 04:00

在当前目录下查找查找包含“hello”的命令,列出文件名。

find . -type f -name "*.txt" | xargs grep "hello" -l


如果你想在当前目录下 查找"hello,world!"字符串,可以这样:grep -rn "hello,world!" ././ : 表示路径为当前目录.-r 是递归查找-n 是显示行号

0 0
原创粉丝点击