I am running a file search command with ag -g foo
and I'd like to see the contents of the files I find.
If I do ag -g foo | xargs more
then the more
command makes me press the spacebar to advance between each file, even though they are small enough that I could see more than one at a time in my terminal window.
If I do ag -g foo | xargs cat
then I see everything at once, but the files are mushed together so it's hard to see where a new file starts.
Is there a way to see the files all in one scroll, but with a heading for each one?
ag -g foo | xargs tail -n+1
. – Quasímodo Nov 02 '20 at 11:35