text: user-1: I have a bunch of .vcf files in a folder and I want to run command below on all of them but doing that one by one manually is really painful. I am seeking for a way in terminal to do that simultaneously. The output would be a .txt file.
  grep -v "##" /file.vcf | awk '{print $1"\t"$2"\t"$2"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11}' > /file.txt
  
  Can you help please?
  
  user6343: If additional CPUs are available:
  CPU_COUNT=5
  for file in *.vcf; do 
       (grep -v "##" ${file} | awk '{print $1"\t"$2"\t"$2"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11}' > ${file%.vcf}.txt) & let count+=1
       [[ $((count%CPU_COUNT)) -eq 0 ]] && wait
  done
  
  one-liner:
  CPU_COUNT=5; for file in *.vcf; do (grep -v "##" ${file} | awk '{print $1"\t"$2"\t"$2"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11}' > ${file%.vcf}.txt) & let count+=1; [[ $((count%CPU_COUNT)) -eq 0 ]] && wait; done
  
  
  user4001: Assuming all your vcfs are in the same folder:
  for file in *.vcf; do
      grep -v "##" ${file} | awk '{print $1"\t"$2"\t"$2"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11}' > ${file}.txt
  done
  
  
original_text: -1: <p>I have a bunch of <code>.vcf</code> files in a folder and I want to run command below on all of them but doing that one by one manually is really painful. I am seeking for a way in terminal to do that simultaneously. The output would be a <code>.txt</code> file.</p>
  
  <pre><code>grep -v "##" /file.vcf | awk '{print <span class="math-container">$1"\t"$</span>2"\t"<span class="math-container">$2"\t"$</span>4"\t"<span class="math-container">$5"\t"$</span>6"\t"<span class="math-container">$7"\t"$</span>8"\t"<span class="math-container">$9"\t"$</span>10"\t"$11}' &gt; /file.txt
  </code></pre>
  
  <p>Can you help please?</p>
   6343: <p>If additional CPUs are available:</p>
  
  <pre><code>CPU_COUNT=5
  for file in *.vcf; do 
       (grep -v "##" ${file} | awk '{print $1"\t"$2"\t"$2"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11}' &gt; ${file%.vcf}.txt) &amp; let count+=1
       [[ $((count%CPU_COUNT)) -eq 0 ]] &amp;&amp; wait
  done
  </code></pre>
  
  <p>one-liner:</p>
  
  <pre><code>CPU_COUNT=5; for file in *.vcf; do (grep -v "##" ${file} | awk '{print $1"\t"$2"\t"$2"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11}' &gt; ${file%.vcf}.txt) &amp; let count+=1; [[ $((count%CPU_COUNT)) -eq 0 ]] &amp;&amp; wait; done
  </code></pre>
   4001: <p>Assuming all your vcfs are in the same folder:</p>
  
  <pre><code>for file in *.vcf; do
      grep -v "##" <span class="math-container">${file} | awk '{print $1"\t"$2"\t"$2"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11}' &gt; $</span>{file}.txt
  done
  </code></pre>
  