The head command differentiates the output from multiple files by prefixing the output of each file with the file name. When you use head on multiple files, it displays the first few lines of each file in the order they are specified in the command.
Here’s an example of how to use the head command on multiple files:
head file1.txt file2.txt
In the output, you will see the first 10 lines of file1.txt followed by the first 10 lines of file2.txt, with the file names indicated in the output. If you want to customize the number of lines displayed, you can use the -n option:
head -n 5 file1.txt file2.txt
This command will display the first 5 lines of each file.
