You can do a few things.
tail are both spec'd to display the first/last ten lines of a file by default - but if called w/ multiple arguments will do that for all and display the filenames for each. And, of course, for each, you can use the
-n[num] argument to specify a number of lines other than the default ten that you would like to display. I assume your CTRL-C problem was related to the
-f option - which would instruct
tail to follow a file - you probably should just leave that out.
Another thing you might do - which will result in output a little different than in the question, but which you might still like, is...
grep -F '' ./*files
grep is also spec'd to display the filename for its matches when it is given multiple filename arguments - but
grep does it at the head of every line. Like
seq 10 >nums.txt; grep -F '' /dev/null nums.txt
...and highlighted on my terminal. The
/dev/null thing is just a little trick to force the multiple file arg behavior even when working with only a single file, and
grep -F '' matches every line - even blank ones.
head /dev/null nums.txt:
==> /dev/null <==
==> nums.txt <==
tail's output is identical in this case - but, again, both utilities only print so many lines of a file.
With the latest version of GNU
sed you can use the
F command like:
sed -s 1F ./*files
...or if you wanted a little border around the filename...
sed -se '1!b;i\\n---' -e 'F;i\---\n' nums.txt
...which does like...
Or if you wanted to get adventurous you could do...
tar -c ./*files | tr -s \\0 | cut -d '' -f1,2,13 | tr '\0' '\n'
...but that's probably not practical.