title: Linux: copy one file from several directories
body: <p>I have a situation where I want to copy a specific file "transaction.log" from thousands of directories under linux and build a tar file containing those same specific files.</p>
  
  <p>Example:
  I have thousands of directories under /user/foo/dirs/</p>
  
  <pre><code>/user/foo/dirs/dir1
  /user/foo/dirs/dir2
  /user/foo/dirs/dir3
  ..
  ..
  ..
  /user/foo/dirs/dir50000
  </code></pre>
  
  <p>In each directories, there are several files and a transaction.log file. I would like to copy this transaction.log file from all the 50000 directories and store them in a tar file.</p>
  
  <p>Can you please help me if there is a way to do so?</p>
  
  <p>Thanks.</p>
  
  <h1>SOLUTION:</h1>
  
  <p>Okies, i found the issue, since there were some sympolic links to other disks find was not working well. solution is to use with -follow option with find to follow the symbolic links. thanks. 
  I use the following command</p>
  
  <p>find . -follow -type f -name "transaction.log" | tar --create --files-from - > /foo/Stats_transaction_Object.tar.gz</p>