MacOS – Mac Terminal read each .txt file in folder and write (add) as text to specific file

command linemacmacosterminal

I have folder with 600+ .txt files.
Each file has couple lines of short text.
I want to create another file and write text from all those files to new one.
Are there some Terminal commands or tools to do this?

Best Answer

This command will take all .txt files combine to a single file.

cat ~/name_of_folder/*.txt > ~/combined.txt