title: Remove part of path on Unix
body: <p>I'm trying to remove part of the path in a string. I have the path:</p>
  
  <pre><code>/path/to/file/drive/file/path/
  </code></pre>
  
  <p>I want to remove the first part <code>/path/to/file/drive</code> and produce the output:</p>
  
  <pre><code>file/path/
  </code></pre>
  
  <p>Note: I have several paths in a while loop, with the same <code>/path/to/file/drive</code> in all of them, but I'm just looking for the 'how to' on removing the desired string.</p>
  
  <p>I found some examples, but I can't get them to work:</p>
  
  <pre><code>echo /path/to/file/drive/file/path/ | sed 's:/path/to/file/drive:\2:'
  echo /path/to/file/drive/file/path/ | sed 's:/path/to/file/drive:2'
  </code></pre>
  
  <p><code>\2</code> being the second part of the string and I'm clearly doing something wrong...maybe there is an easier way?</p>