Techwetrust is a programming blog maintained by Alin Alexandru, a young Python developer. He addresses topics like Python tutorials, Docker tutorials and other tech-related articles.

How to append text to an existing file in Linux or Mac OS?

If you want to add a new line to an existing file from the terminal, use the following format: echo 'hello world' >> file.txt
Double greater-than sign >> will append text to the desired file.


echo "example paragraph" > test.txt
example paragraph
echo "another paragraph" >> test.txt
example paragraph

another paragraph

Alin Alexandru


Hello! My name is Banuta Alexandru Alin and I am working as a full-time programmer. I have experience in data mining, data science, and data parsing/crawling. I like to travel when I have some days off. May my knowledge help you and protect your way!

Leave a Reply