Show line number when search a single file
This issue was raised as a bug for ack
Output line numbers of matches when acking a single file #244 with the following response:
All future development on ack is happening on https://github.com/petdance/ack2. This issue has been moved here: Do we need an option for forcing the printing of the line number? #196
The status of the ack2 request is open.
Output line numbers of matches when acking a single file #244 does include a patch which may resolve the issue as well as the following comment:
Nevertheless using
--with-filename
option will always print file name and therefore line numbers.
You can append "more" to your command and it will display the file name and line numbers for each result
Example:
ack test test.c more
test.c
12: something here that had test
17: something here that had test
32: something here that had test