1Setup: 2 3 $ . $TESTDIR/setup.sh 4 $ unalias ag 5 $ alias ag="$TESTDIR/../ag --noaffinity --nocolor --workers=1" 6 $ printf "blah\n" > blah.txt 7 $ printf "blah2\n" >> blah.txt 8 $ printf "blah_OTHER\n" > other_file.txt 9 $ printf "blah_OTHER\n" >> other_file.txt 10 11Count matches: 12 13 $ ag --count --parallel blah | sort 14 blah.txt:2 15 other_file.txt:2 16 17Count stream matches: 18 19 $ printf 'blah blah blah\n' | ag --count blah 20 3 21 22Count stream matches per line (not very useful since it does not print zero): 23 24 $ cat blah.txt | ag --count blah 25 1 26 1 27