如何在目录中的所有文件中搜索文本? [英] How to search for text in all files in a directory?

查看:31
本文介绍了如何在目录中的所有文件中搜索文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用 VS Code 在目录中的所有文件中搜索文本?

Is there a way to search for text in all files in a directory using VS Code?

即,如果我在搜索中输入find this,它将搜索当前目录中的所有文件并返回匹配的文件.

I.e., if I type find this in my search, it will search through all the files in the current directory and return the files that matched.

推荐答案

您可以进行编辑在文件中查找(或 Ctrl+Shift+F - 默认键绑定,Cmd+Shift+F 在 MacOS 上) 搜索当前打开的文件夹.

You can do Edit, Find in Files (or Ctrl+Shift+F - default key binding, Cmd+Shift+F on MacOS) to search the Currently open Folder.

对话框中有一个省略号,您可以在其中包含/排除文件,以及搜索框中用于匹配大小写/单词和使用正则表达式的选项.

There is an ellipsis on the dialog where you can include/exclude files, and options in the search box for matching case/word and using Regex.

这篇关于如何在目录中的所有文件中搜索文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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