The following script works to cat all files in a directory without header but prints the file name. How can I cat without file name.

tail -n +2 * >> Compile

Alternative method:

for f in *; do tail -n +2 "$f" >> Compile; done

sed can be used to miss out lines:

sed -s 1d * >> Compile

this is assuming the folder only contains test files though; I just checked here and it didn't like directories at all, while tail coped.

You could use find then though if needed:

find . -maxdepth 1 -type f * | xargs sed -s 1d >> Compile

Added the -s Flag for separate. This deals with each file separately but is GNU only from the looks of things, unfortunately

  • Ah... one minute! – Guy Jan 5 '17 at 22:00
  • Oh dear.. I may get there eventually.. cheers for the corrections! – Guy Jan 5 '17 at 22:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.