title: how to automatically write curl output to a new file
body: <p>I am using <code>cURL</code> to retrieve stock information back to the terminal window on my Mac using the yahoo finance api. </p>
  
  <p>i.e. I type:</p>
  
  <pre><code>curl -s 'http://download.finance.yahoo.com/d/quotes.csv?s=aapl&amp;f=l1'
  </code></pre>
  
  <p>and it prints the output (in this instance the last trade price in the command line)</p>
  
  <p>It works terrific, but I would like to know how to get this output automatically written to a stock.txt file located on my desktop without any manual intervention upon the execution of the original cURL command. </p>
  
  <p>Thus after I type the curl  query that contains the stock ticker, I get the value written in the terminal window and the txt file. </p>