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

Your email address will not be published. Required fields are marked *

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