Using echo; What is difference between > and >>
<p>I came across this on a git site:</p>

<pre><code>mkdir log
echo '*.log' &gt; log/.gitignore
git add log
echo tmp &gt;&gt; .gitignore
git add .gitignore
git commit -m "ignored log files and tmp dir"
</code></pre>

<p>So in the first instance of echo, we are writing the string to the file .gitignore in the log dir. In the second instance, are we writing tmp to the file .gitignore (in current dir). Why do we need to use >> versus > ?</p>