0

I use "ack-grep" to search for a specific content within a large number of files.

Because the search takes a very long time, I would like to see the status of the search. For example: It would be very useful, if ack-grep would print out the actual searching path, instead showing just a blank screen while the searching process is in progress.

Does anyone know, how to make ack-grep printing out status-information while searching is in progress?

Edit Here is the command I used until yet:

ack-grep StringToSearchFor --type=cc
Lui
  • 159
  • 9

4 Answers4

1

Sorry, but ack does not have any sort of progress indicator.

It may make more sense for you to use grep for your searching, unless you are using any ack-specific features. Can you tell more about what it is that you're searching? Is it all source code?

Andy Lester
  • 91,102
  • 13
  • 100
  • 152
  • I added an example to my question above for you. I am searching for a string within source code and only source code. – Lui Feb 26 '15 at 07:18
  • I'm not seeing anything weird there, and using --cc means you're only searching the files you need to be, so I don't know if there's anything you could do to speed things up, other than use grep. – Andy Lester Feb 26 '15 at 15:12
0

It is not what you are looking for, but maybe this helps

grep -H "you searched expression here" /your/path/here/*.php

It will grep in that dir (add -R if you need recursive) and you will see output as expression in found. Or you can redirect output to a log file, and tail -f logfile so that you can see current current status

candymanuu
  • 110
  • 7
0

If speed is your problem, rather than showing progress using ack you might look at using an alternative, ag, also known as the the-silver-searcher.

ag is not 100% compatible with ack - "It started off as a clone of Ack, but their feature sets have since diverged slightly. In typical usage, Ag is 5-10x faster than Ack."

jwd630
  • 4,529
  • 1
  • 20
  • 22
0

From https://serverfault.com/questions/343197/grep-progress-bar-using-pv-pipe-viewer/735274#735274

You can use the proc-filesystem on Linux systems, i.e.

ls -al /proc/<pid of grep>/fd

This lists all the files that the grep-process has open currently and thus provides information about where in the search it is currently.

Community
  • 1
  • 1
centic
  • 15,565
  • 9
  • 68
  • 125