Questions tagged [ack]

ACK is a greplike tool optimized for programmers searching large heterogeneous trees of source code.

Filter by
Sorted by
Tagged with
0 votes
1 answer
102 views

how to detect unbalanced special characters in string

I'm wondering what would be the best way (likely using grep or ack) to return lines containing unbalanced special character sets in a string? For example, if the string were: bqM#+t1U"OyBGhk]ozVG[...
irishwristwatch's user avatar
2 votes
2 answers
85 views

Why Doesn't This Shell Script Work?

I've got the following shell script #!/bin/bash # Search elixir code with ack # By default skip the dependencies and test directories ignore_dirs=("dependencies" "test" "...
Onorio Catenacci's user avatar
1 vote
1 answer
114 views

ack regex logical OR

I want to ignore the file if the filename match any of these words : copy, cony, coby OR tool, trol, thol etc. This one works : ack -l -i --ignore-file=match:/co.y/ --ignore-file=match:/t.ol/ "...
andio's user avatar
  • 113
0 votes
1 answer
476 views

Understanding ACK numbers

I try to understand the reason of unordered ACK numbers. I have the following logs in wireshark: 34936 → 80 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=3595656117 TSecr=0 WS=128 2 0....
Tina's user avatar
  • 84
0 votes
1 answer
379 views

Behaviour of single and double quotes depending on shell

I've been scratching my head for quite some time with this.... Inspired by this answer, I'm trying to run 'ack' and to find either a single quote or a double quote in source files. Doing this in bash ...
DaveC's user avatar
  • 1
4 votes
2 answers
244 views

ack : get the 10th (or bigger nth) matching/capturing group

I think I might have just searched wrong, but I didn't find any answer. If there's a duplicate, please just let me know, and I can take this down. Problem Background I'm using ack (link), which has ...
bballdave025's user avatar
0 votes
1 answer
572 views

How to grep contents in HEX specifying the pattern in decimals?

I have a file with the following contents (as a text file in UTF-8) e04ba1af81d887979ddcee1dc23f2531 43f85926fdb6a668386ee354f8b836a1 b53614f5139c052ec08ea1ecd2532daf e9b3914d7b1e1bf8e6feab621330245b ...
Enbugger's user avatar
  • 109
2 votes
1 answer
147 views

Can ack read patterns from a file?

grep can look for a list of patterns written in a file with grep -f patterns_file search_files Can ack read a list of patterns from a file?
lolesque's user avatar
  • 301
1 vote
2 answers
294 views

How to highlight terms in an output that has a live update?

I'm doing a loop over ffmpeg to convert a bunch of videos, and I would like to highlight some terms in ffmpeg's output. But the solution I tried always made the live progress of the conversion ...
Cqoicebordel's user avatar
1 vote
0 answers
40 views

Can ag search sub-directories with the same name, within a bunch of directories?

Given a directory structure such as: dev/project1/assets/** dev/project2/assets/** dev/project3/assets/** Is it possible to search, from within the dev directory all assets directories only. Given ...
Kris's user avatar
  • 235
0 votes
1 answer
356 views

Ack/Ag does not return search result without *

I am trying to search text in a directory and it turned out that the following syntaxes do not return any result ack -i "0xabcdef" ./ ack -i "0xabcdef" ack -i "0xabcdef" . while the following ...
user2065276's user avatar
3 votes
1 answer
767 views

Ignore files without extension in ack

I would like to define a file type that would enable me to ignore all files without extension in ack. In my .ackrc file I have added: --type-set=csv:ext:csv,tsv To handle CSV files that I often ...
Konrad's user avatar
  • 323
15 votes
3 answers
12k views

How to ignore multiple files with `ag` The Silver Searcher

There is an option --ignore which allows specifying files to ignore. At the moment I only managed to ignore multiple files by doing --ignore file1 --ignore file2....... Trying to use --ignore "*...
T.Chmelevskij's user avatar
2 votes
1 answer
17k views

Mac Terminal command - Find string and print with surrounding line

I have been testing using ack, sed, grep trying to search through files in a directory to find a particular string. I am looking through my database files to check to see if passwords are listed in ...
user3324136's user avatar
0 votes
1 answer
286 views

Ack syntax for a file containing foo and bar [closed]

What's the ack syntax to find all files containing foo and also bar?
student's user avatar
  • 18.1k
2 votes
1 answer
3k views

fast retransmit does not work

Fast retransmit says that if 3 dupacks have been received by sender, then the sender should retransmit the lost packet. But my tcpdump output shows that it didn't work like this. It didn't retransmit ...
chengtcli's user avatar
3 votes
0 answers
185 views

Using ack to effectively search and RStudio project directory

I'm interested in running ack search on a RStudio project directory that mostly contains *.R script files but also some project files and often *.git files. Directory The project folder structure ...
Konrad's user avatar
  • 323
1 vote
1 answer
129 views

ack executed through vim

I am trying to execute ack from vim. But for some reason vim decides to stop after executing ack. How can I stop vim from stopping? (on some systems what I call ack is called ack-grep) What I am ...
Veda's user avatar
  • 206
1 vote
1 answer
178 views

Examine a bunch of huge files

I have a folder with big files (few GB each). I would like to search aPATTERNthrough these files. I can do this with grep or ack: $ grep -n 'PATTERN' /path/to/files/*.log Now, I have a list with all ...
Loom's user avatar
  • 3,903
10 votes
2 answers
4k views

How do I ack-grep exclude file type *.sql files or file size larger than >3MB?

I want to search my directory for "foo" in the files, but i have these gigantic sql files. How do I exclude these file types or file sizes larger than 3MB using ack-grep? Also how would this be done ...
Patoshi パトシ's user avatar
1 vote
1 answer
805 views

How do you install Ack-Grep on Red Hat Linux 6.5?

I'm not sure how to install ack-grep for redhat linux 6.5. Google only returned results on how to install it for mainly centos and ubuntu only. But what about Redhat? Why isn't there that many users ...
Patoshi パトシ's user avatar
2 votes
1 answer
104 views

How does this text reformatting happen with ack?

If I do a plain ack for a string, I get a line with the filename, and then the line numbers and the matching lines, like so: $> ack function mymodule.file 8: function myfunction1() { 16: public ...
user394's user avatar
  • 14.3k
19 votes
3 answers
4k views

`ack` doesn't show line numbers on a single file

I'm using ack to search for a string. When I run it without a file argument, I get line numbers: $> ack function themes/README.txt 7:Drupal's sub-theme functionality to ensure easy maintenance and ...
user394's user avatar
  • 14.3k
2 votes
5 answers
1k views

Why can't I pipe to ack?

So I've been trying to use grep to extract some stuff from a Mercurial log and trying to avoid using awk just to see if I can get by without it here, and failing because neither grep nor egrep support ...
temporary_user_name's user avatar
4 votes
2 answers
581 views

Is there `find`'s `-exec` like option in `ack-grep`?

I want to remove all texts that include string foo. I can list all files by ack-grep foo, but I couldn't find a way to remove all files like -exec rm {} option like find. How can I delete all files ...
ironsand's user avatar
  • 5,135
3 votes
1 answer
75 views

ack.pl tool and ack.pl flags

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 ...
maihabunash's user avatar
  • 7,031
1 vote
2 answers
2k views

How to search parenthesis by ack

I want to search for a parentheis ( using ack, but neither using ( nor \( worked. The first one ("(") is recognized as a multiple line command. The second one ("\(") is treated as an invalid regular ...
ironsand's user avatar
  • 5,135
2 votes
2 answers
2k views

Ack regex on filenames

According to this thread: Q: My understanding is that ack uses Perl-derivative regular expressions, is that correct? A: Yes. In fact, ack is written in Perl and just forwards the expressions ...
Amelio Vazquez-Reina's user avatar
1 vote
3 answers
132 views

How to pick out files in a folder in which the header contains specific text?

Use case: Let's say there is a folder full of large RDF+XML files and they follow different namespaces. We want to find those files that follow a given namespace (for example xmlns:crm="http://www....
Kristo Aun's user avatar
4 votes
2 answers
1k views

How to search all text files in Ack? (with --text option being now removed)

Manual says that "The --text option has been removed.". It was setting the --type to text, i.e. ack was searching all text files regardless of their semantic category (i.e. in *.php files, *.txt files,...
Jerry Epas's user avatar
8 votes
2 answers
7k views

ack/grep search and sort by modification date

Is there any way to have ack sort the results found by date of modification? (ideally showing the date next to the result?). It doesn't look like ack has a date option, but just in case. If this isn'...
Josh's user avatar
  • 1,704
59 votes
9 answers
42k views

Search only in files that match a pattern with ack

Can ack search only through files that match a specific 'glob' pattern (eg: search for foo in all files named "bar*.c"). The command ack foo "bar*.c" only works in the current directory. Note: I ...
compie's user avatar
  • 783
1 vote
3 answers
734 views

Installing ack on cpanel

I need to install ack on an instance of whm/cpanel (I have root access as it is a VPS) but I have not found any information on how to do that. I tried to install it using the WHM RPM manager, but the ...
Ali Samii's user avatar
  • 441
59 votes
4 answers
47k views

How to do max-depth search in ack and grep?

Is there any way to tell ack to only search for text on the current folder? (or specify a max-depth level?) And with grep?
Amelio Vazquez-Reina's user avatar
14 votes
2 answers
6k views

Search ALL files with ack

How can I search all files (including binary) in the current directory with ack v2? I want to do the same as doing ack 'foo' **, but just with a flag, so it works if I want to search all files in a ...
Tyilo's user avatar
  • 5,951
1 vote
2 answers
532 views

Match a simple Regex

I need to match this: (tt\d{1,10}) in a file with the file ending txt. I have tried grep and ack-grep but without results. ack-grep -G \.txt$ -g "(tt\d{1,10})"
Patrik's user avatar
  • 167
2 votes
3 answers
2k views

Web front-end to find/grep/ack

In my lab, we are trying to build a web that allows the user to enter queries for find, ack, grep on a specific directory. The web would return an HTML with a table of a list of clickable files (click ...
Amelio Vazquez-Reina's user avatar