title: How can I prevent tar from creating an empty archive?
body: <pre><code>/tmp/-&gt; ls ab*
  /tmp/-&gt; ls: ab*: No such file or directory
  
  /tmp/-&gt; tar -cvf ab.tar abc*
  tar: abc*: Cannot stat: No such file or directory
  tar: Error exit delayed from previous errors
  /tmp/-&gt;
  /tmp/-&gt; ls ab*
  ab.tar
  /tmp/-&gt; tar -tvf ab.tar
  /tmp/-&gt;
  </code></pre>
  
  <p>As can be seen there are no files matching pattern abc*, however output file named ab.tar got created with no content. Is there a switch/option than can be passed to tar command so that no output file is created when there are no input file?</p>