Skip to content

Instantly share code, notes, and snippets.

@deepak
Created January 29, 2013 13:37
Show Gist options
  • Select an option

  • Save deepak/4664291 to your computer and use it in GitHub Desktop.

Select an option

Save deepak/4664291 to your computer and use it in GitHub Desktop.
match a word in grep or ack
age=10
age=11
age = 12
age=13
hello. age = 14
message = "hello"
@deepak
Copy link
Copy Markdown
Author

deepak commented Jan 29, 2013

% ack -w age /tmp/test.txt
age=10
age=11
age = 12
age=13
hello. age = 14

@deepak
Copy link
Copy Markdown
Author

deepak commented Jan 29, 2013

note to future self: have more descriptive variable names

@deepak
Copy link
Copy Markdown
Author

deepak commented Feb 5, 2013

for Rails, came up with:

function rails_ack() {
    # ack -w $1 db/ app/ config/ lib/ public/
    ack -w --ruby --html --rake --ignore-dir=doc --ignore-dir=log $1 .
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment