You can use the head -q or –quiet or –silent option to disable the printing file name in the header. For a single file, it’s the default behavior, but for multiple files, you can use this option to suppress the printing of filenames in the header.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
## create a file with 100 lines > myfile; i=1; while [ $i -le 100 ]; \ do echo "$i" >> myfile; ((i++)); done ## create some additional files cp myfile myfile1 cp myfile myfile2 ## default - single file head myfile ## filenames are not printed as header ## default - multiple files head myfile myfile1 myfile2 ## filenames are printed as header ## with -q or --quiet or --silent option head -q myfile myfile1 myfile2 ## filenames are not printed as header rm my* |