Grep, ack, Ag usage record

Source: Internet
Author: User

# Grep 里面要无视某些目录 # 但 --exclude-dir=dir 需要 GNU Grep >= 2.5.2 grep -ri --exclude-dir=.git [someWords] *.java  # 來玩一下 ACK 这东西 # 安裝和使用 brew install ack ack --java --no-heading [someWords]  # 关于颜色这方面的查看 网址: http://perldoc.perl.org/Term/ANSIColor.html 里面: Function Interface 里面      - recognized normal foreground color      - recognized normal background color  # 简单设定一下 echo "--smart-case" >> ~/.ackrc echo "--heading" >> ~/.ackrc echo "--flush" >> ~/.ackrc echo "--color-line=lightblue" >> ~/.ackrc echo "--color-match=on_blue" >> ~/.ackrc echo "--all-types" >> ~/.ackrc  # 最后就可以简化执行 ack --java [someWords]  # 再來安裝 ag 这个比 grep, ack 还快的玩意 brew install the_silver_searcher  # 安裝过程中可能会出现如下所示的错误 checking for style of include used by make... GNU checking dependency style of cc... none checking whether make supports nested variables... yes ./configure: line 3911: syntax error near unexpected token `PCRE,‘ ./configure: line 3911: `PKG_CHECK_MODULES(PCRE, libpcre)‘  Error: the_silver_searcher did not build Logs: /Users/[用戶]/Library/Logs/Homebrew/the_silver_searcher/ Help: https://github.com/mxcl/homebrew/wiki/troubleshooting  # 解決方法,重新建立 PKG 的软链接,并且重新安装 brew link pkg-config brew install the_silver_searcher  # 如果还不行,就 source ~/.bash_profile 或 csh && bash brew link pkg-config brew install the_silver_searcher  # 简单测试一下,搜寻当前目录内的某些关键字 #参数都很像 ack,不过好像沒有 .ackrc? ag [someWords] ag -a -S [someWords]

Source https://www.chair.im /? P = 1152

Grep, ack, Ag usage record

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.