Linux递归查找具有给定字符串的文件名 [英] Linux find file names with given string recursively

查看:117
本文介绍了Linux递归查找具有给定字符串的文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ubuntu上,我想在当前目录和子目录中找到名称包含字符串"John"的所有文件.我知道grep可以匹配文件的内容,但是我不知道如何在文件名中使用它.

I'm on Ubuntu, and I'd like to find all files in the current directory and subdirectories whose name contains the string "John". I know that grep can match the content of the files, but I have no idea how to use it with file names.

推荐答案

使用查找命令,

find . -type f -name "*John*"

这篇关于Linux递归查找具有给定字符串的文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆