linux - 如何使用 find 和 grep 列出文件名

标签 linux bash shell command-line

我想根据文件名模式列出递归目录中的文件名。

这是我迄今为止开发的代码:

find . -name "*pipeline*" | grep -R 'pipeline'

但是它的输出是:

static/js/angular/angular-scenario.js:   * and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged
static/js/angular/angular-scenario.js:   * will not invoke the `$parsers` and `$validators` pipelines. For this reason, you should
static/js/angular/angular.js: * * if the value returned from the `$parsers` transformation pipeline has not changed
static/js/angular/angular.js: * @property {Array.<Function>} $parsers Array of functions to execute, as a pipeline, whenever
static/js/angular/angular.js: * @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever
static/js/angular/angular.js:   * and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged
static/js/angular/angular.js:   * will not invoke the `$parsers` and `$validators` pipelines. For this reason, you should
social/pipeline.py:    print ("at pipeline *******", details, uid, social, kwargs, response)

我期望的结果将是一个带有pipeline的文件名,如下所示:

social/pipeline.py
social/__pycache__/pipeline.cpython-35.pyc

最佳答案

命令

find ./ -type f -print | grep -i pipeline*

输出将是

./social/pipeline.py
./social/__pycache__/pipeline.cpython-35.pyc

关于linux - 如何使用 find 和 grep 列出文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46089030/

相关文章:

linux - 在 yii2 中设置 Gii 权限

linux - 将文件从 linux vps 上传到虚拟主机

linux - 有没有办法让 ProxyHTMLURLMap 每个标签属性匹配多次?

regex - 具有正则表达式循环值的 shell 脚本输入字符串

Rscript 检测 R 脚本是否正在被调用/源自另一个脚本

linux - 将参数保存在传递给 shell 脚本的不同变量中

javascript - Node JS 在 Amazon Linux 中以普通用户身份运行时找不到模块 'node-properties-parser' 错误

bash - 搜索复制的作业

linux - unix下同步四个shell脚本依次运行

bash - 从 ChromeBook 安全 shell 脚本启动网页?