LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-11-2013, 01:13 AM   #1
gayatri_justin
LQ Newbie
 
Registered: Mar 2013
Posts: 5

Rep: Reputation: Disabled
Unhappy create a text file using terminal and to add contents into it


i am new to linux and i want to create a text file using terminal and to add contents into it.
How can i achieve that??
 
Old 03-11-2013, 01:27 AM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
You can create a new (or overwrite an existing) file with > For example:
Code:
echo Here is some text > test.txt
You can append to that file with >> For example:
Code:
echo Some more text >> test.txt
You can create a file and add several lines to it with the following syntax:
Code:
cat > another.file << "EOF"
Here is a line of text
Some more text
Even more text
EOF
Was that what you were looking for?
 
1 members found this post helpful.
Old 03-11-2013, 01:36 AM   #3
gayatri_justin
LQ Newbie
 
Registered: Mar 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thank you for the quick reply....it helped me.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Using Expect/TCL to move contents of a text file to an executable file jefsa Linux - Newbie 4 04-20-2012 10:43 AM
[SOLVED] Redirecting terminal output to text file leads to corrupted text file mariovrn Linux - Newbie 5 11-30-2011 07:21 AM
[SOLVED] read a text file distrubute its contents on different text files magische_vogel Programming 13 02-26-2011 06:51 PM
create text file from terminal acidjuice Linux - Software 8 09-03-2010 03:46 AM
text match pipe to file then delete from original text file create new dir automatic tr1px Linux - Newbie 6 09-10-2008 09:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration