简体   繁体   English

如何在VS Code的文件夹中列出特定扩展名的所有文件?

[英]How to list all the files of a specific extension in a folder in VS Code?

How to list all the files of a specific extension in a folder in VS Code?如何在VS Code的文件夹中列出特定扩展名的所有文件?

Let us suppose I have a folder with a deep subfolders structure.让我们假设我有一个具有深层子文件夹结构的文件夹。 In that structure there are a lot of files of different extensions like: .html, .ts, .scss.在该结构中有很多不同扩展名的文件,例如:.html、.ts、.scss。 Now I want to get a list of all the files with the.html extension.现在我想获取所有扩展名为 .html 的文件的列表。 How can I do that?我怎样才能做到这一点?

Preferably I want not to see the subfolders structure.最好我不想看到子文件夹结构。 Just as when I search for a specific word I can limit file types to a specific extension in a specific folder - in this case I am given a list of files, with which I can easily work without a need to expand directories or read through the different from what I need extensions.就像当我搜索特定单词时,我可以将文件类型限制为特定文件夹中的特定扩展名 - 在这种情况下,我会得到一个文件列表,我可以轻松地使用这些文件,而无需扩展目录或阅读不同于我需要的扩展。

Partial solution for the problem is to figure out what patterns one is looking for in the files, then it is possible to use the in files search.该问题的部分解决方案是找出在文件中寻找的模式,然后可以使用文件内搜索。 Eg ./pathToMyFolder/**/*.html .例如./pathToMyFolder/**/*.html But I just need to open each.html file and I do not have a pattern to look for.但我只需要打开 each.html 文件,我没有要查找的模式。 And expanding each subdirectory and traversing it makes things really messy and cumbersome for me.扩展每个子目录并遍历它让我觉得事情真的很混乱和麻烦。 Also, there are files with other extensions and filtering them out also takes time.此外,还有其他扩展名的文件,将它们过滤掉也需要时间。

Ctrl P and type *.[desired extension]. Ctrl P 并输入 *.[期望的扩展名]。 Say *.cs说 *.cs

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在文件夹中的所有文件中搜索特定短语? - How to search specific phrase in all files in folder? 如何从Perl中的文件夹获取具有特定扩展名的文件名 - How to get files names with specific extension from a folder in perl 如何在 VS Code 中的特定文件中搜索? - How to search within specific files in VS Code? 如何在 Visual Studio Code 中列出/搜索特定类型的所有文件 - How do I list/search all files of a specific type in Visual Studio Code 如何获取目录中具有ESY扩展名的所有文件的列表? - How to get list of all files with ESY extension in a directory? 如何使用 PowerShell 搜索特定文件名然后将该文件之后的所有文件移动到另一个文件夹 - How to search for a specific file name then move all files after that file to another folder using PowerShell make:使用grep在文件夹内的所有文件中查找特定的字符串 - make: Use grep to look for specific string in all files within a folder 如何按扩展名搜索文件并在文件夹和子文件夹中包含字符串? - How to search for files by extension and containing string within folder and subfolders? 在 VS 代码中是否可以选择包含某些文件夹中的文件并按文件扩展名/文件名过滤? - In VS code is there option to include files from some folders AND filter by extension/name of file? 获取文件夹中具有特定扩展名的第一个文件 - Get the first file with specific extension in a folder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM