-1

I have a list of 10 files that I want to merge into one file.

file1.txt
file2.txt
...
file10.txt

I normally do this with cat

cat file*.txt > merged_file.txt

However, I don't want the lines starting with '#' to be included in the merged_file.txt. How do I do this?

user1987607
  • 2,057
  • 6
  • 26
  • 53

1 Answers1

2

Something like this: cat file*.txt | egrep -v '^#.*$' > merged_file.txt