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
1
vote
2 answers

ack outputs nothing using crontab in linux

ack outputs nothing using crontab in linux. In the crontab file (edited with sudo crontab -e): 39 20 * * * /ext/test110.sh And cat /ext/test110.sh will show #! /bin/sh /usr/bin/ack "localhost" /etc/hosts > /ext/1.t which ack > /ext/2.t After…
Zhilong Jia
  • 2,329
  • 1
  • 22
  • 34
1
vote
1 answer

How can I tell ack to search in two distinct directories?

Is it possible to ask ack to search and include results from multiple root directories, rather than searching from the current shell working directory?
Joshua Goldberg
  • 5,059
  • 2
  • 34
  • 39
1
vote
1 answer

Searching/Finding C/C++ Source but not Headers

I tried ack -f --cpp --nohh but it returns no results. I'm using 2.14 on OSX.
Kenny
  • 675
  • 10
  • 24
1
vote
1 answer

How do I use ack's --ignore-file option?

If I put --ignore-file=example.txt into my .ackrc or on the ack command-line, I get the error message "Invalid filter specification "example.txt". The ack documentation says that the --ignore-file option takes a filter as an argument. What's a…
skiphoppy
  • 97,646
  • 72
  • 174
  • 218
1
vote
1 answer

Vim with ACK: Search for all #pragma not ending in once

Using ACK in Vim, I want to find all instances of #pragma that does not end in once within C++ related files. What is the regex I need to use? #pragma\s+.*(?
Matthew Hoggan
  • 7,402
  • 16
  • 75
  • 140
1
vote
1 answer

ack type doesnt work when dot is part of extension

Trying to use this method to eliminate garbage files from being ack'd, however my definition does not work: --type-set=map=.min.map --no-map This still produces the result $ ack MARK -l …
Steven Lu
  • 41,389
  • 58
  • 210
  • 364
1
vote
1 answer

Filter duplicates in file by using columns as parameters (grep linux)

I am looking for the pattern #type in a set of files. As output I should return the lines containing that pattern. The lines are organized as columns with tab separator: <#type> <#type> <#type>…
Hani Goc
  • 2,371
  • 5
  • 45
  • 89
1
vote
1 answer

Bash script which lists all files that contain a string literal excluding packages in OS X

Right now I'm using ack to list all the files in a directory which contain a string literal. This outputs not only normal files but also special files called packages or bundles which are actually directories on OS X. That is fine except I'm piping…
Steve Moser
  • 7,647
  • 5
  • 55
  • 94
1
vote
2 answers

is it possible to scan a file in reverse (bottom up) using ack?

Is it possible to scan a file for a pattern in reverse (bottom up) using ack (the grep alternative)? Right now I am using: tac filename | grep -m1 blablabla but a friend mentioned that ack might be able to do this type of thing without the use of…
lacrosse1991
  • 2,972
  • 7
  • 38
  • 47
1
vote
1 answer

ack not accepting shorthand character classes?

When I search for \d with ack, it brings up every match for the letter "d" rather than for digits 0-9 as the \d shorthand class should represent, identical to [0-9]. Why might this be? I read through the man page and didn't find anything about it.…
temporary_user_name
  • 35,956
  • 47
  • 141
  • 220
1
vote
2 answers

How to look for files not having the word TEST using ack

I love ack. I need to search for 'foo' in all the files except the test files. ack has option -G to specify regex. However I am not sure how do I write regex for the condition that look for all files but ignore files with word 'test'.
Nick Vanderbilt
  • 36,724
  • 29
  • 83
  • 106
1
vote
2 answers

Using ack/grep with globstar option for big directory tree (performance issue?)

I'd like to use globstar option '**' of bash to search files with a certain directories, as is customary is used with grep. However, the following command just started and did nothing ack PATTERN ~/projects/**/trunk/ How I can search in files with…
Loom
  • 9,768
  • 22
  • 60
  • 112
1
vote
1 answer

ack results do not contain newlines in zsh

I use zsh as my default shell When I do a simple ack command like $ ack a_string it does not insert a newline between the lines that match. So they all get jumbled up like a_string is on this linethis is another line a_string is onand a third…
scottmrogowski
  • 2,063
  • 4
  • 23
  • 32
1
vote
1 answer

How to use option to specify file name extensions for ack?

I'd like to specify the file name extensions when searching in a folder of files. Read the man page of ack and still confused. Why something like the following not working? ack --type-add=xlog=.xlog "foobar" Update I use ack 2.14 under Perl…
qazwsx
  • 25,536
  • 30
  • 72
  • 106
1
vote
1 answer

Is it possible to install Ack on windows without network?

I use two PC for work, one can access internet, the other one can not, it's for development. I want to install Ack for better use VIM on the development PC. Is there a Installer for Ack or other ways can install it without network? PC are both…
Cynial
  • 680
  • 8
  • 23