Display content of files with filenames

Use the following linux command to display the contents of several files with their filenames prepended.

tail -n +1 file1.txt file2.txt file3.txt

Displays as

==> file1.txt <==

File 1 contents

==> file2.txt <==

File 3 contents

==> file3.txt <==

File 3 contents

Leave a Reply