1
sobigfish 2012-02-20 17:06:57 +08:00
sublime text 的search in files。。。其实很多文本编辑里都有
mac的搜索也支持。 |
2
sobigfish 2012-02-20 17:07:35 +08:00
win的话 Turbo search
|
3
Sunyanzi 2012-02-20 17:15:55 +08:00
这么简单的需求何须用软件 ...
grep -lr 'keyword' path l 代表显示文件 ... r 代表递归 ... 如果搜索复杂内容可以加上 -e 使用正则匹配 ... |
5
bitsmix 2012-02-20 17:24:03 +08:00
|
6
kojp 2012-02-20 17:34:21 +08:00
我表示editplus支持正则,有时候非常方便~~~
|
7
freewizard 2012-02-20 17:43:05 +08:00
|
8
Sunyanzi 2012-02-20 17:49:38 +08:00
@bitsmix do not give others something you are unsure of as the answer ...
---------------------------------------------------------------------------- Sunyanzi-MacBook-Air:test Sunyanzi$ echo Sunyanzi > a.txt Sunyanzi-MacBook-Air:test Sunyanzi$ grep -r '*yanzi*' . Sunyanzi-MacBook-Air:test Sunyanzi$ grep -rE '*yanzi*' . ./a.txt:Sunyanzi Sunyanzi-MacBook-Air:test Sunyanzi$ |
9
bitsmix 2012-02-20 18:02:07 +08:00
@Sunyanzi
Well... `-E` indicate that you run grep with `extended-regexp`, if you have any doubt about this, read the man page and wikipedia. beside, i pretty sure about what i said, and what i did. so, why don't you test your case with some regular express, not the extended one? |
10
lisztli 2012-02-20 18:40:27 +08:00
说下你的环境呗,如果*nix系统的话,就用grep -rn。
如果你凑巧还是vim用户的话,那就装一下grep.vim 如果你是windows用户,强烈推荐你用source insight + total commander, 后者经常有团购,可以买正版。 如果你用vs系列的话,应该有一堆插件可以装(vc6那个年代有va,新的我就没有用过了) -------------- 其实我写这对都是为了拜8楼的硬嘴大牛的 |
11
Sunyanzi 2012-02-20 18:49:35 +08:00
好吧试了半天终于研究出来了 ...
你是对的 ... 是我土鳖了 ... Sunyanzi-MacBook-Air:test Sunyanzi$ grep -r '^[A|S]un.*' . ./a.txt:Sunyanzi Sunyanzi-MacBook-Air:test Sunyanzi$ 成功测试通过 ... 那么改为 [ 使用扩展正则 ] 匹配好了 ... |
13
lisztli 2012-02-20 19:11:25 +08:00
|
14
kaiix 2012-02-20 19:22:53 +08:00
ack-grep
|
15
cuijiudai 2012-02-21 23:58:16 +08:00
window 下有everything,超快。
mac和linux 用命令查找当前目录和子孙目录下的: find . -name "*.jsp" | xargs grep -n "这里输入要找到词" |
16
cuijiudai 2012-02-21 23:59:23 +08:00
哦,错了,everything是文件名的搜索。
|
17
zhigang1992 2012-02-22 00:06:56 +08:00
用命令行选出来,mate到一个项目了。。。用TextMate
|
18
zskj 2012-02-22 10:32:42 +08:00
win下 文本替换专家 //对中文搜索不好 其他还行~~
|
19
bitsmix 2012-02-22 10:38:44 +08:00
@zhigang1992 还是 grep 吧.. mate 过去多慢,且不说版权的事情
|
20
wynemo 2012-02-22 10:56:16 +08:00
順道問下 grep對中文支持如何
|
21
nouh 2012-02-22 11:29:52 +08:00
用Ack吧,比grep更好用,而且textmate和vim都有针对它的插件
|