Questions tagged [ack]

ack is a tool like grep, designed for programmers with large trees of heterogeneous source code.

ack is a tool like grep, designed for programmers with large trees of heterogeneous source code. http://beyondgrep.com

262 questions
13
votes
1 answer

What is the meaning of !#:3?

curl http://beyondgrep.com/ack-2.02-single-file > ~/bin/ack && chmod 0755 !#:3 What is the meaning of !#:3, from ack installation guide?
ohho
  • 50,879
  • 75
  • 256
  • 383
12
votes
2 answers

How do i exclude comments from ack results?

Hi im new to ack (actually started half an hour ago). Im impressed by the quality of the search results. But in my source files there are a lot of comments and if i search for a class/function-name i get about 20 results with commented lines and 2…
Shylux
  • 1,163
  • 2
  • 16
  • 31
12
votes
2 answers

Ack in terminal vim is flashing it's output before presenting search results. How to stop it?

I'm using vim inside gnome-terminal in Ubuntu 12.04 and also in MacOS's terminal. I use the ack.vim plugin to perform project wide textual searches and it works fine but there's an uncomfortable and distracting bug: When you perform a search, the…
Rafael Vega
  • 4,575
  • 4
  • 32
  • 50
11
votes
1 answer

How do I get Ack to ignore jQuery files?

I'm using Vim + Ack.Vim and am flummoxed on how to ignore hits within Jquery files. I've got an .ackrc file defined (see below), but I'm stabbing in the…
Dave Sanders
  • 3,135
  • 4
  • 33
  • 43
11
votes
4 answers

Can I create an ack file type based on a filename, not extension?

I would like to include files with a specific name -- not an extension -- in my ack search. Is this possible with ack? If I use the -G option, this would exclude all other file types. (So I can't put it in my .ackrc file.) I tried to use --type-set…
Marvin
  • 482
  • 5
  • 19
11
votes
1 answer

How to make ack include .conf files?

How to configure ack (sometimes distributed as ack-grep) to always include .conf files into search?
Henno
  • 1,448
  • 4
  • 18
  • 30
11
votes
2 answers

Unable to add a type in ack

Everytime I try add a type in ack seem to fail i.e add a type (log) in ack ack --type-set log:ext:log ack: No regular expression found. or ack --type-add log:ext:log ack: No regular expression found. Anyone has a clue about this or it only
Ratatouille
  • 1,372
  • 5
  • 23
  • 50
10
votes
2 answers

Ack & negative lookahead giving errors

I have a problem with using ack-grep with a negative look ahead. I am running this command: ack-grep "paypal_responded(?!_at)" but I am getting the error: bash: !_at: event not found I have tried adding backslashes in various places, but I'm also…
TobyG
  • 1,692
  • 3
  • 21
  • 36
10
votes
1 answer

Ignoring sub-directories in .ackrc

I'd like to get my .ackrc configured so ack doesn't look inside my test/coverage folder. So far I've ended up with this : --ignore-dir=coverage This works, but it doesn't feel quite as right as : --ignore-dir=test/coverage Problem is the latter…
Bastes
  • 1,116
  • 1
  • 9
  • 18
10
votes
1 answer

Search through .zst text files

I have large zstd-compressed text files. How can I run fast search over them ? Can I use AG (The Silver Searcher) or something similar ? I've tried AG but it doesn't work, I have a "failed to load error" : ag -z -i "term"
titibouboul
  • 1,348
  • 3
  • 16
  • 30
9
votes
3 answers

How do I exclude files and directories from a project in vim (using janus)?

I'm moving from Textmate to vim (with janus) and want to exclude some directories from Ack in particular, and also NERDTree. The reason I want to do this is that Ack is useless (takes minutes to run, and produces no results) with one of my large…
i2w
  • 118
  • 2
  • 6
8
votes
4 answers

What is generally faster, grepping through files or running a SQL LIKE %x% query through blobs?

Say I'm designing a tool that would save code snippets either in a PostgreSQL/MySQL database or on the file system. I want to search through these snippets. Using a search engine like Sphinx doesn't seem practical because we need exact text matches…
dan
  • 43,914
  • 47
  • 153
  • 254
8
votes
3 answers

Getting ack to search through .htaccess or other dotfiles

Is there any way to get ack to search through a file whose filename starts with a . (e.g. .htaccess), without resorting to the --all or --unrestricted options? I've tried adding the following to my ~/.ackrc file to no…
Andrew
  • 81
  • 1
8
votes
3 answers

How do you make `git grep` output look like `ack` output?

I've recently found git grep and come to like its speed and de facto searching of only the files in the repo. But coming from ack (ack-grep in Ubuntu), one thing left to be desired is the output formatting, which is unfortunately much more like grep…
CivFan
  • 13,560
  • 9
  • 41
  • 58
7
votes
1 answer

Multiple patterns with ack-grep?

Is it possible (and how) to chain patterns with ack (ack-grep on some distributions of Linux) like I'm used to with grep? e.g. grep "foo" somefile.c | grep -v "bar" ...to match all lines with "foo" but without "bar".
scrrr
  • 5,135
  • 7
  • 42
  • 52
1 2
3
17 18