深度阅读

How to recursively search for files by file name and extension with the 'find' command in Linux?

作者
作者
2023年08月22日
更新时间
7.15 分钟
阅读时间
0
阅读量

To recursively search for files by file name and extension with the ‘find’ command in Linux, you can use the following command:

find /path/to/directory -type f -name "*.extension"

This will find all files with the specified extension in the specified directory and its subdirectories. You can replace /path/to/directory with the path to the directory you want to search, and replace extension with the file extension you want to search for.

For example, to search for all files with the extension .txt in the directory /home/user/files, you can use the following command:

find /home/user/files -type f -name "*.txt"

I hope this helps! Let me know if you have any other questions.

相关标签

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。