Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

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.

Example

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

another Paragraph



This post first appeared on TechWeTrust, please read the originial post: here

Share the post

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

×

Subscribe to Techwetrust

Get updates delivered right to your inbox!

Thank you for your subscription

×