title: How to use grep to retrieve a string within a line
body: <p>MacOS, Unix</p>
  
  <p>I'm trying to use grep to isolate a particular ID within a line as follows:</p>
  
  <pre><code># STOCKHOLM 1.0
  
  #=GS WP_002089484.1/1-154 DE [subseq from] MULTISPECIES: AAC(3)-I family aminoglycoside 3-N-acetyltransferase [Proteobacteria]
  
  WP_002089484.1/1-154 MGIIRTCRLGPDQVKSMRAALDLFGREFGDVATYSQHQPDSDYLGNLLRSKTFIALAAFDQEAVVGALAAYVLPKFEQARSEIYIYDLAVSGEHRRQGIATALINLLKHEANALGAYVIYVQADYGDDPAVALYTKLGIREEVMHFDIDPSTAT
  #=GR WP_002089484.1/1-154 PP 9*******************************************************************************************************************************************************98
  #=GC PP_cons                 9*******************************************************************************************************************************************************98
  #=GC RF                      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  //
  </code></pre>
  
  <p>I just want to isolate the part that says WP_002089484.1, but I have to do this for many files, where the ID always starts with "WP_" and always ends with ".1". And I just want unique occurrences from each file. </p>
  
  <p>I tried something like:</p>
  
  <pre><code>grep -o "WP_.\{0,11\}" *.sto &gt;&gt; ProtID
  </code></pre>
  
  <p>but ProtID still has all the information from the original file. </p>