We Recommend

bash Cookbook: Solutions and Examples for bash Users bash Cookbook: Solutions and Examples for bash Users
bash Cookbook teaches shell scripting the way Unix masters practice the craft. It presents a variety of recipes and tricks for all levels of shell programmers so that anyone can become a proficient user of the most common Unix shell -- the bash shell -- and cygwin or other popular Unix emulation packages.


Posted By

engel on 11/28/07


Tagged

file Bash to a line write cat append


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

moonbather


Append Line to a File


Published in: Bash 


Running this command will append a line with given values to a file you specify. Replace words between < and > with the values you desire.

  1. echo "<string to append>" >> <file>
  2.  
  3. #Example:
  4.  
  5. echo "My string" >> /home/user/myfile.txt

Report this snippet 

You need to login to post a comment.