title: sed - Remove all of a line except matching pattern
body: <p>I am working at trying to parse out hashtags from a file. For instance:</p>
  
  <pre><code>Some text here #Foo Some other text here....
  </code></pre>
  
  <p>I would like the output to be:</p>
  
  <pre><code>#Foo
  </code></pre>
  
  <p>The text before and after the # can change and I'm trying to apply this to multiple lines of the file. Every line will have a # in it as I already grep'd the file for hashtags. </p>
  
  <p>Basically I'm trying to create a list of the hashtags that are contained in a file. If there is also a way to remove duplicated tags from the resulting output that would be a bonus. </p>