title: Copying files containing specific text in its content from a folder to other
body: <p>At times I have come across a situation whereby I have to copy all the files containing a specific pattern in its content from a folder to another.</p>
  
  <p>For example, <code>DirA</code> contains 100 files, out of which there are 60 files which contains a pattern <code>FOO</code>. My requirement is to copy these 60 files from <code>DirA</code> to <code>DirB</code>.</p>
  
  <p>I typically write a small shell script to do this job and it works properly. However, I am trying to understand if there is a way to it only using a combination of some commands such that I need not write any shell script.</p>