Linux找到给定字符串的文件名 [英] Linux find file names with given string

查看:167
本文介绍了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 in the files, but I have no idea how to use it with file names. Any help would be appreciated.

推荐答案

使用> find 命令,

Use the find command,

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

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

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