Questions tagged [ack]
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.
38
questions
1
vote
0
answers
90
views
When searching twice pressing enter in the quickfix windows doesn't work
I'm on MacVim and I'm using the ack plugin for searching .vimrc
Plug 'mileszs/ack.vim'
let g:ackprg = 'ag --vimgrep --smart-case'
When I type :Ack search_term the first time after opening vim, the ...
1
vote
1
answer
48
views
ack print matches found in one line on one line not mutiple
Right now ack prints out all the matches separated by a newline. I'd like it so that all matches in one line are also printed on one line... possible?
I can add --with filename which prints out the ...
1
vote
1
answer
72
views
Ack for files with two phrases on Windows
I want to Ack for files that contain both "foo" AND "bar". I found lots of answers for how to do this on Linux, but not on Windows.
12
votes
1
answer
7k
views
Ack/Ag/Pt just list files?
For a Unix/Unix-like OS...
So, I know I can just use find . to list all of the files recursively from the current folder. This includes files I am not interested in.
Using Ack, Ag (silver searcher), ...
1
vote
2
answers
164
views
grep for a word, but also mention another word(s) that should appear in the file
I'm looking for occurrences of the word 'image' in a folder with many files and subfolders.
The regular grep commands (grep and 'git grep') return over a thousand matches. How can I add something to ...
21
votes
2
answers
7k
views
ack-grep show the matched files name only. Do not show the matched content
I'm searching some keywords among minified files.
It doesn't make sense to show those minified content.
How could I use ack-grep 'SEARCH_WORD' and show the matched file names only
0
votes
1
answer
26
views
Conflicting type flags in ack
I have added a custom type to my .ackrc and it does just what I want.
--type-set=test:match:/_test\b/
It matches unit test files. Since I don't want to see test usages more often than I do, I also ...
29
votes
1
answer
10k
views
Limiting silver-searcher to only search specific file types
I'm doing ag "active_record" ., but I want to only care about .rb files.
How do I limit what file types it searches on the command line?
0
votes
0
answers
237
views
Close ESTABLISHED connection based just on a SYN/ACK sequence
After the discussion "Connection remains flagged as ESTABLISHED even if host is unconnected" I am back again to ask for further information.
Resume: I have a remote host (Windows client) which ...
1
vote
0
answers
44
views
ack.pl tool and ack.pl flags + how to ignore files with S attr
I am using the ack.pl tool in order to search string or IP’s in files
The official site of ack.pl is - http://beyondgrep.com/documentation/
Example of ack.pl CLI ( want to find the string ...
12
votes
1
answer
882
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 ...
6
votes
2
answers
774
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
1
answer
564
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
3
answers
551
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?
4
votes
3
answers
537
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 ...
3
votes
1
answer
257
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
1
answer
81
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
2
answers
313
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
1
answer
72
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
haystack....
0
votes
1
answer
119
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 --type-set ...
2
votes
1
answer
1k
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?
7
votes
2
answers
2k
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 ...
3
votes
1
answer
2k
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 's/from/...
2
votes
1
answer
1k
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 ...
2
votes
1
answer
773
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 : <code>...
3
votes
1
answer
573
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 ..
drwxr-...
6
votes
2
answers
2k
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 ...
4
votes
1
answer
3k
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
2
answers
818
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
1
answer
1k
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
8:</div>&...
11
votes
2
answers
6k
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 ...
3
votes
1
answer
1k
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
2
answers
233
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 ...
5
votes
1
answer
1k
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 ...
14
votes
3
answers
9k
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 ...
17
votes
3
answers
3k
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 ...
18
votes
4
answers
10k
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?
8
votes
3
answers
1k
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?