递归查找具有特定扩展名的文件 [英] Recursively find files with a specific extension

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

问题描述

我正在尝试查找具有特定扩展名的文件. 例如,我要查找所有名为Robert

I'm trying to find files with specific extensions. For example, I want to find all .pdf and .jpg files that's named Robert

我知道我可以执行此命令

I know I can do this command

$ find . -name '*.h' -o -name '*.cpp'

但是我需要指定扩展名之外的文件本身的名称. 我只想看看是否有一种方法可以避免一次又一次地写入文件名 谢谢!

but I need to specify the name of the file itself besides the extensions. I just want to see if there's a possible way to avoid writing the file name again and over again Thank you !

推荐答案

我的偏好:

find . -name '*.jpg' -o -name '*.png' -print | grep Robert

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

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