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, *.cpp files, etc.). How to obtain this behavior in current version of ack
?
Asked
Active
Viewed 1,306 times
4

Jerry Epas
- 359
2 Answers
6
Use ack
without a --type
predicate:
ack <search pattern>
It ignores binary files and searches all textual files regardless of file type.

garethTheRed
- 33,957
-
1This is not the same bahavior. As I have clearly described in question, ACK was searching in text files regardless of their semantic category, i.e. in .php files, .pl files, etc. – Jerry Epas Nov 25 '14 at 00:53
-
1I have clearly edited my answer for you ;-) – garethTheRed Nov 25 '14 at 06:38
-
Good luck with a minified js file. It's invisible to ack, even for those magical special type searching in other answers. I think it might be because of line length (3247 chars). – Luciano Fantuzzi Feb 14 '19 at 20:31
1
ack 2 no longer has a --text
option because ack 2's default behavior is to search all text files.
This means that
ack1 --text foo
is the same as
ack2 foo

Andy Lester
- 718