ack is a grep-like utility that allows searching using Perl-like regular expressions instead of the ed-like regular expressions from grep. Note: On Debian systems and derivatives like Ubuntu it's called ack-grep due to a naming conflict with a Kanji-related tool which is named ack, too.

learn more… | top users | synonyms

2
votes
0answers
13 views

Breadth-first search with ack or grep

When I search e.g. my home directory with ack (or grep), I normally want to know where I set a specific option. Since most config files are really close to ~ it would considerably speed up ack if I ...
0
votes
1answer
13 views

Show line number when search a single file

ack usually shows line numbers with file name, $ ack searchme filename 1:searchme but it doesn't when search a single file, $ ack searchme filename searchme It's easy to show line numbers with ...
0
votes
1answer
44 views

OpenBSD: Prioritizing empty ACKs

There is a wildly used example concerning PF and prioritising empty ACK packets, so that an an asynchronous connections' downstream does not lose performance, if the upstream is clogged up. The ...
1
vote
3answers
66 views

Is there anything grep does better than ack? [closed]

I started using ack a while ago and it's amazing, but still begs the question: Is there anything grep still does better than ack? Or maybe is there something grep does that ack can't do?
2
votes
3answers
107 views

Gnu parallel and ack not playing nicely due to stdin, pipe

I'm trying to use parallel and ack together to do some searching in parallel. However, ack seems to insist on using stdin if it finds itself in a pipe, even if you give it files to search: $ echo ...
1
vote
1answer
43 views

Configure ack on a per-directory basis

My goal is to not have to always tell ack which directories to grep in a given project (if I don't, it's slow because it scans non-source folders as well). I've so far come up with puting an ...
0
votes
1answer
26 views

PhpStorm and Ack for source code reading

I need tools to browse large amounts of PHP source code and have heared PhpStorm (the source code IDE from JetBrains) and Ack (The Perl5 module from beyondgrep.com) are some of the best tools for the ...
2
votes
2answers
82 views

Opening search results with Vim ONLY if they exist

:) In my never-ending effort to get lazier, I am looking for a way to improve my "Open Grep/Ack-results in Vim"-snippet. What I'm currently using to open found files is: vim $(ack -il "pattern") ...
1
vote
1answer
39 views

Ack doesn't seem to use its whitelist

I have ack 2.04 and it searches not only files in its whitelist but everything - logs, text, tags. $ echo 'needle' | tee haystack.txt haystack haystack.log $ ack needle haystack 1:needle ...
0
votes
1answer
36 views

Why doesn't --type-set work in ack?

In my .ackrc file I have this line --type-set=vm=.vm But when I run ack-grep --vm blah it searches all types of files. Neither does this work: ack-grep blah --type-set vm=.vm ack-grep ...
1
vote
1answer
381 views

Open all files in a VIM split window view with grep/ack command

I did a ack-grep on files that contain a string. I then want to open these files in a VIM veritcal split window view. How can this be done via the terminal?
1
vote
0answers
104 views

Why is grep faster than ack [closed]

I have access to, but no admin rights on, one of our Ubuntu production server, so I had to install the single file version of ack. I did a trial run (ack vs grep). The results are not impressive and ...
2
votes
2answers
189 views

How do you ack for a file that contains two or more phrases/words?

How do you use ack to search for a file that contains, for example, cat dog mouse anywhere in the file? Each phrase occur at least once in the file. This is kind of like the behavior of an online ...
2
votes
1answer
546 views

How to ack-grep replace a string of multiple words

The following command replaces every occurence of the word from in any file of the current directory or its subdirectories with to: ack-grep -l --print0 --text from | xargs -0 -n 1 sed -i -e ...
2
votes
1answer
285 views

How to output a partial or a number from a mataching in grep or ack

I have a text file demo.txt like below. This is a line with id (9) This (8) is another line with id (10) This is a line with id too 11 This line does nothing The file has some lines with id ...
1
vote
1answer
170 views

Showing line number with filename in ack

when I search using ack I get results like this /path/to/file/name 42: <code>goes here</code> How do I get ack to return results like this instead: /path/to/file/name:42 : ...
1
vote
1answer
132 views

How can I get a list of directories with ack?

I have a directory listing as follows (given by ls -la): total 8 drwxr-xr-x 6 <user> <group> 204 Oct 18 12:13 . drwxr-xr-x 7 <user> <group> 238 Oct 18 11:29 .. ...
6
votes
2answers
1k views

Macports install of ack doesn't create correct executable

I am trying to install p5-app-ack port from Mac Ports, but it seems it doesn't create a /opt/local/bin/ack binary at the end: $ sudo port search *app-ack Password: p5-app-ack @1.960.0 (perl) A ...
3
votes
1answer
1k views

Why doesn't ack recursively search all files by default?

From everything I can read ack-grep foo should search through all files in the current directory and subdirectories for the term "foo". However, the closest I can get is ack-grep foo * Which ...
2
votes
2answers
352 views

Using ack to search for regex in a specific file type

Wondering if there's a way to look for something like ack foo "*.scss"
1
vote
1answer
149 views

how to make 'ack' command print the filename that has found the result on every line

By default ack command prints the output in follwing way ack --jsp '</div>' a.jsp 5:</span></div> 10:</table></div> b.jsp 3:</div><div>xyz ...
5
votes
2answers
1k views

How do I map <cmd>-<shift>-f to run Ack plugin in Vim?

I'm new to vim and I'm trying to map a key combo for running the Ack plugin found here: https://github.com/mileszs/ack.vim I want to map cmd-shift-f to run the Ack command :Ack. I've added the ...
2
votes
1answer
560 views

ack doesn't recurse when specifying a file pattern

ack "#define" will recurse into subdirs and find files that contain #define. But I wanted to limit the search to *.h files, so I tried ack "#define" *.h and it doesn't recurse anymore. The only ...
2
votes
2answers
176 views

Can I simulate ack by using grep with the right combination of options?

I have ack-grep installed on my local machine, and find it indispensable for quickly 'acking' through a codebase when debugging. However, on my cheap shared hosting, there is no ack-grep. One of the ...
3
votes
1answer
528 views

Using Ack.vim's quickwindow in vim

I am using ack.vim with vim. I get my search results back in a vim quickwindow which is great. Only problem is that I have to hit [enter] to open the file that's displaying in the quickwindow. On thee ...
1
vote
1answer
806 views

Is there a command in Mac OS X that can perform multiline regex searching?

I want to do a simple regex search recursively through a directory that isn't restricted to single lines. I tried grep and ack, but neither seem to support this. I know it shouldn't be too ...
16
votes
2answers
2k views

Adding file type to ack permanently

I've recently learned how to let ack support more filetypes (adding the following to .ackrc): --type-add latte=.latte Unfortunately, that produces an info line on every ack search I use, even ones ...
12
votes
3answers
6k views

How to use ack to search for file name

I have started using ack which is much faster than grep. However using ack I want to search for file name rather than file contents. Is there a way to do that?
7
votes
1answer
773 views

grin, ack and rak comparison

Having used ack for some time now, I find it much better for my development purposes than grep. But then I've heard about rak and grin. Has anyone used all three of them and can provide a comparison? ...