title: Single line sftp from terminal
body: <p>Several times throughout the day, I may be running a test where I need to look through a log file on a remote server. I've gotten used to using my terminal to <code>sftp</code> into the remote server and pull the desired log file down to <code>/tmp</code> on my local machine.</p>
  
  <p>I was looking through the options today using <code>man sftp</code> in an attempt to figure out a way to run the following commands basically in a single line so that I don't have to type a command, press enter, type a command press enter, etc. </p>
  
  <p>(what I do now)</p>
  
  <pre><code>sftp myuser@myserver
  --mypassword at prompt
  lcd /tmp
  get /dir/dir/dir/dir/file
  quit
  </code></pre>
  
  <p>I found while looking through <code>man sftp</code> a reference to <code>scp</code> which I haven't used before. I feel it may be what I'm looking for, but I didn't see a way to specify where I wanted the securely copied file to go. </p>
  
  <p>Could someone provide me with a way to get <code>/dir/file</code> from a remote server and have it download to <code>/tmp/file_plus-my-description</code>?</p>
  
  <p>I was hoping to be able to run an sftp or scp command similar to a regularUNIX copy like:</p>
  
  <pre><code>scp myuser@myserver /dir/file /tmp/file_plus-my-description
  </code></pre>
  
  <p>I'm using the built in <code>Terminal</code> in Mac OS X 10.8. Thanks.</p>