title: How to grep for a pattern in the files in tar archive without filling up disk space
body: <p>I have a tar archive which is very big ~ 5GB.</p>
  
  <p>I want to grep for a pattern on all files (and also print the name of the file that has the pattern ) in the archive but do not want to fill up my disk space by extracting the archive.</p>
  
  <p>Anyway I can do that?</p>
  
  <p>I tried these, but this does not give me the file names that contain the pattern, just the matching lines:</p>
  
  <pre><code>tar -O -xf test.tar.gz | grep 'this'
  tar -xf test.tar.gz --to-command='grep awesome'
  </code></pre>
  
  <p>Also where is this feature of tar documented? tar xf test.tar $FILE</p>