Depende do que realmente está em foo
ou se você informou ack-grep
para reconhecer como type
# using ack-grep Version 1.92
mkdir junk; cd junk
echo 'hello' > wango
ack-grep hello # nothing found, because 'wango' is an unknown type
echo -e '#!/bin/bash\nhello' > wango
ack-grep hello # found, because '#!/bin/bash' identifies a known type
wango
2:hello
echo 'hello' > wango
ack-grep -a hello # found, because '-a' selects all files (almost all)
wango
1:hello
De man ack-grep
ack-grep is intelligent about the files it searches. It knows about certain file types, based on both the extension on the file and, in some cases, the contents of the file. These selections can be made with the --type option.
With no file selections, ack-grep only searches files of types that it recognizes. If you have a file called foo.wango, and ack-grep doesn't know what a .wango file is, ack-grep won't search it.
The -a option tells ack-grep to select all files, regardless of type.
Some files will never be selected by ack-grep, even with -a, including:
· Backup files: Files matching #*# or ending with ~.
· Coredumps: Files matching core.\d+
However, ack-grep always searches the files given on the command line, no matter what type. Furthermore, by specifying the -u option all files will be searched.