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

This site uses Akismet to reduce spam. Learn how your comment data is processed.