To show the headers for each csv file in a directory.
#!/bin/bash # Echo the header lines for all the cvs files in the current directory for filename in *.csv; do # echo $filename; line=$(head -n 1 $filename); echo $line; done