Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(15)
在 Windows 上,有一个类似于 grep 的“find”命令。
您还可以下载 cygwin 或其他一些 Unix 模拟器并从中获取 grep。
在 Windows 上,您还可以使用“unxutils”包获取独立版本的 grep: http://unxutils.sourceforge.net /
On Windows, there's a "find" command that is similar to grep.
You could also download cygwin or some other Unix emulator and get grep from that.
On Windows, you can also get a standalone version of grep with "unxutils" pack: http://unxutils.sourceforge.net/
对于 Windows,我过去曾使用过 Agent Ransack,效果非常好。
For Windows I've used Agent Ransack before in the past and it's done a pretty good job.
我为此使用 Notepad++。 它甚至有正则表达式支持。
搜索->在文件中搜索
I use Notepad++ for this. It even has regex support.
Search->Search in files
Textpad 是一个非常有用且便宜的编辑器,具有非常好的跨目录搜索功能。
它甚至允许您快速转到搜索结果中提到的每个文件/行,只需重复按 F4 即可。
Textpad is a very useful - and cheap - editor that has very good cross-directory searches.
It even allows you to quickly go to each of files/lines mentioned in the search results, just by pressing F4 repeatedly.
Eclipse 功能强大而且免费。 Ctrl + Alt + H 将搜索 Eclipse 支持的任何语言的方法、声明、类型或自由文本。 您甚至可以使用通配符和正则表达式。
例如,我一直在努力寻找某种方法的所有访问权限。 Eclipse 再次为我做得很好:Ctrl + H 将打开 Call Hierarchy 视图。
Eclipse is powerful and is free. Ctrl + Alt + H will search for methods, declarations, types or just free text in any language Eclipse supports. You can even use wildcards and regex.
I've been struggling with finding all the access to some method, for example. Once again, Eclipse does it for me very well: Ctrl + H will open the Call Hierarchy view.
确认 提供与 grep 相同的选项,其目的是在源代码中搜索、跳过临时文件和二进制文件、核心转储。 它是一个 Perl 脚本,因此可以在 Unix 和 Windows 系统上运行。
Ack provides the same options as grep does, it is aimed at searching in source code, skipping temporary and binary files, core dump. It's a Perl script so can run on Unixes and Windows systems.
由于您似乎使用的是 Windows,Google 告诉我您实际上可以使用 DOS 命令行:
在此处查找更多示例: http:// /kennethhunt.com/archives/000173.html
Since it seems that you're on Windows, Google tells me you can actually use the DOS cmd line:
Find more examples here: http://kennethhunt.com/archives/000173.html
如果是在 Mac 上,TextWrangler 非常适合使用 grep 进行多文件搜索。
If it's on a Mac, TextWrangler is rather fantastic for multi-file search with grep.
我还没有见过 PowerGrep,但 Visual Studio 的“在文件中查找”最适合我。 还允许“在文件中替换”并打开更改的文件以启用撤消。
I have not seen PowerGrep but Visual Studio's "Find in files" works best for me. Also allows "Replace in files" and opens changed files to enable undo.
在最新版本的 Windows 上,findstr.exe 将为您提供良好的服务,它比 find.exe 具有更多功能。
它不像 grep 那样强大,但它可以工作。 /n 给出行号,/m 只给出文件名。
如果您忘记了文件规范,它只会等待终止。
我还建议学习 cmd shell 脚本。 以“为了/?”开头。
On recent versions of Windows you'll be well served with findstr.exe which has more features than find.exe.
It's not as powerful as grep but it works. The /n gives you line numbers, /m will just give you filenames.
If you forget the file spec it will just wait around for termination.
I'd also recommend learning cmd shell scripting. Start with "for /?".
我知道您要求免费软件,但如果其他人正在浏览这个问题,我建议您查看 洗脱液查找。 我几年前买的,每天都用。 我为不同类型的搜索设置了很多路径计划和扩展配置。
它有点老化,似乎没有升级,但它的工作原理如广告所示,不确定他们会添加什么。 每年左右我都会四处查看竞争对手,但没有发现任何更适合我的东西。 路径规划是关键特征。
20 美元。
I know you're asking for freeware, but in case anyone else is browsing this question, I'd recommend a look at Eluent Find. I bought this years ago, and use it daily. I have lots of path plans and extension configs set up for different types of searches I do.
It's aging a bit, doesn't seem to be getting upgraded, but it works as advertised, not sure what they'd add to it. Every year or so I look around around to check the competition, and haven't found anything that works better for me. The path plans are the key feature.
$20.
如果您安装 cygwin,您将获得
find
和grep
实用程序,它们可以像这样一起使用:或者简单地递归 grep,如果您不关心过滤文件扩展名:
If you install cygwin, you get the
find
andgrep
utilities, which can be used in concert like so:Or simply recursive grep, if you don't care about filtering by file-extension:
Google 桌面。 一旦它对您的文件建立了索引,就可以非常快速地在所有文件(代码或其他文件)中进行搜索。 您还可以按文件类型搜索。
如果您使用的是 Windows XP,我不推荐 Windows Live Search; 它又慢又笨重。
Google Desktop. Once it's indexed your files, it's very fast for searching for and within all your files - code or otherwise. You can also search by file type.
If you're using Windows XP, I wouldn't recommend Windows Live Search; it's slow and clunky.
您也可以尝试科莫多编辑。 它是一个支持多种语言并支持递归搜索目录的开发 IDE。 它是用 Java 编写的,因此可以在“每个”平台上运行。
http://www.activestate.com/komodo_edit/
You could also try Komodo Edit. It's a development IDE that supports many languages and has support for recursively searching directories. It's written in Java so it works on "every" platform.
http://www.activestate.com/komodo_edit/
另一次投票给 ack。 它的用处怎么强调都不为过,它确实是处理大型代码库时最好的朋友。
Another vote for ack. It's usefulness can not be overstated, it truly is your best friend when dealing with a large code base.