简体   繁体   中英

How to search words in text files faster than “grep” of linux command?

I have many files including code. I need to search function as well as different keywords. Currently I am using "grep -i -r 'keyword to search'" in linux to search. However, I need to increase searching speed to reduce time.

I have also heard about Boyer-Moore algorithm which is a fast searching one. But the result I have obtained isn't my expectation.

So I am very looking forward to hearing your comments and solutions

  • You should try ack ( homepage ). It is designed as fast search tool for code.
  • If you want to have the ability to search your code with taking language syntax into account (distinguishing between functions and symbols) you should try Exuberant ctags .

There are several tools that are prospectively worthwhile, relative to the popular Ack. The first one that came to mind for me was The Silver Searcher.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM