Does grep have a way to segment output by file? By Alvin Lai November 19th, 2009 Yes! Use the -H flag: grep -H <string u wanna grep for> log/*