I would like to concatenate a number of text files into one large file in terminal. I know I can do this using the cat command. However, I would like the filename of each fi
If you want to replace those ugly ==> <== with something else
tail -n +1 *.txt | sed -e 's/==>/\n###/g' -e 's/<==/###/g' >> "files.txt"
explanation:
tail -n +1 *.txt
- output all files in folder with header
sed -e 's/==>/\n###/g' -e 's/<==/###/g'
- replace ==>
with new line + ### and <==
with just ###
>> "files.txt"
- output all to a file