Issue
I have a set of files with similar naming pattern. I am trying to get the total row count of all the files combined sans the header in a go. But I am having trouble with the commands.
sed '1d' IN-Pass-30* | wc -l
and
awk 'END {print NR-1}' IN-Pass-30*
But each time it only subtracts the header count from just one file. What am I doing wrong here?
Solution
You were close. Wrap the sed command in a bash glob loop:
for f in IN-Pass-30*; do sed '1d' "$f"; done | wc -l
Answered By - Cole Tierney Answer Checked By - Timothy Miller (WPSolving Admin)