ack is a grep-like utility that allows searching using Perl-like regular expressions instead of the ed-like regular expressions from grep.

learn more… | top users | synonyms

2
votes
2answers
43 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 ...
1
vote
1answer
69 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
49 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
41 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
65 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 .. ...
5
votes
2answers
420 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
306 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
72 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
61 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 ...
4
votes
1answer
504 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 ...
1
vote
1answer
170 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 ...
1
vote
2answers
133 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
287 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
298 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 ...
14
votes
2answers
1k 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 ...
8
votes
3answers
4k 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?
5
votes
1answer
543 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? ...