OpenGroks搜索技巧

OpenGrok 是一款强大的源代码搜索引擎,支持多种查询语法,包括布尔运算符、范围查询、模糊搜索等。用户可以使用正则表达式、通配符、模糊匹配和接近度搜索来精确查找代码。查询字段包括全字段、定义、引用和路径等。此外,OpenGrok 还提供了符号高亮和智能窗口功能,便于用户导航和分析代码。
摘要由CSDN通过智能技术生成

Examples:

To find where setResourceMonitors is defined:
defs:setResourceMonitors

To find files that use sprintf in usr/src/cmd/cmd-inet/usr.sbin/:
refs:sprintf path:usr/src/cmd/cmd-inet/usr.sbin

To find assignments to variable foo:
"foo ="

To find Makefiles where pstack binary is being built:
pstack path:Makefile

to search for phrase "Bill Joy":
"Bill Joy"

To find perl files that do not use /usr/bin/perl but something else:
-"/usr/bin/perl" +"/bin/perl"

To find all strings beginning with foo use the wildcard:
foo*

To find all files which have . c in their name (dot is a token!):
". c"

To find all files which start with "ma" and then have only alphabet characters do:
path:/ma[a-zA-Z]*/

To find all main methods in all files analyzed by C analyzer (so .c, .h, ...) do:
main type:c

More info:

A Query is a series of clauses. A clause may be prefixed by:

  • a plus "+" or a minus "
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值