Fastest way to write a text file in Linux

This isn’t exactly an awesome trick but nonetheless i have seen people who open up full fledged word processors just because they want to type a single line of text and save it. Well, here’s a really fast and g33k way of doing it –

1. Open a terminal

2. Type the following on the prompt –

echo This is a line of text which i would like to save > myfile.txt

What happens above is the echo command sends the text u type after the echo keyword to the output stream. The “>” or the redirect output redirects this to the file “myfile.txt”. There – simple and fast


About synapse
Programming, motorcycles and photography. Want to do more, but only have time for so much!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: