Ack is Better than Grep

Posted by AllenWei | Posted in Tips | Posted on 15-02-2010-05-2008

View Comments




<brck”:http://betterthangrep.com/ written by perl, is a kind of grep, but faster than Grep, and smarter

Install using port

sudo port install p5-app-ack

ok, try out.

suppose you have a rails foler, run  ack --ruby rails .,
You can see it shows result very fast, and have keyword highlight.

is it impressive?

More usage man ack, You will forget grep
ack --help-typesack

    --[no]actionscript .as .mxml
    --[no]ada          .ada .adb .ads
    --[no]asm          .asm .s
    --[no]batch        .bat .cmd
    --[no]binary       Binary files, as defined by Perl's -B op (default: off)
    --[no]cc           .c .h .xs
    --[no]cfmx         .cfc .cfm .cfml
    --[no]cpp          .cpp .cc .cxx .m .hpp .hh .h .hxx
    --[no]csharp       .cs
    --[no]css          .css
    --[no]elisp        .el
    --[no]erlang       .erl .hrl
    --[no]fortran      .f .f77 .f90 .f95 .f03 .for .ftn .fpp
    --[no]haskell      .hs .lhs
    --[no]hh           .h
    --[no]html         .htm .html .shtml .xhtml
    --[no]java         .java .properties
    --[no]js           .js
    --[no]jsp          .jsp .jspx .jhtm .jhtml
    --[no]lisp         .lisp .lsp
    --[no]lua          .lua
    --[no]make         Makefiles
    --[no]mason        .mas .mhtml .mpl .mtxt
    --[no]objc         .m .h
    --[no]objcpp       .mm .h
    --[no]ocaml        .ml .mli
    --[no]parrot       .pir .pasm .pmc .ops .pod .pg .tg
    --[no]perl         .pl .pm .pod .t
    --[no]php          .php .phpt .php3 .php4 .php5
    --[no]plone        .pt .cpt .metadata .cpy .py
    --[no]python       .py
    --[no]rake         Rakefiles
    --[no]ruby         .rb .rhtml .rjs .rxml .erb .rake
    --[no]scheme       .scm .ss
    --[no]shell        .sh .bash .csh .tcsh .ksh .zsh
    --[no]skipped      Files, but not directories, normally skipped by ack (default: off)
    --[no]smalltalk    .st
    --[no]sql          .sql .ctl
    --[no]tcl          .tcl .itcl .itk
    --[no]tex          .tex .cls .sty
    --[no]text         Text files, as defined by Perl's -T op (default: off)
    --[no]tt           .tt .tt2 .ttml
    --[no]vb           .bas .cls .frm .ctl .vb .resx
    --[no]vim          .vim
    --[no]xml          .xml .dtd .xslt .ent
    --[no]yaml         .yaml .yml


Ads Plugin created by Jake Ruston's Wordpress Plugins - Powered by and football database.