I'd like to use globstar option '**' of bash to search files with a certain directories, as is customary is used with grep. However, the following command just started and did nothing
ack PATTERN ~/projects/**/trunk/
How I can search in files with ack using similar search place?
EDIT: I tried to perform same line on model directory with few files. And it works fine. So, it looks like that operator ** demands too much resources (it has a recursion, I guess) and when I execute the command, it just iterate through file tree. By the way, the following command slows down the computer and it was a reason I tried ack command.
grep -r PATTERN ~/projects/**/trunk/
So, I'd like to know is there some workaround to gain my goal (not necessarily with **)?
This should work:
\find -X . -type d -name trunk | xargs -L 1 ack PATTERNThe
-Xargument, from thefindmanualEDIT: Based on the comments better solution may to be (works on BSD/GNU find/xargs AFAICT):
\find . -type d -name trunk -print0 | xargs -0 -L 1 ack PATTERNI guess it will depend on whether your end command can take the arguments with the funny filenames