10

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
Kusalananda
  • 333,661
canswiss
  • 101

2 Answers2

9

Alternative method:

for f in *; do tail -n +2 "$f" >> Compile; done
Alexander
  • 9,850
6

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

Guy
  • 894