title: Nohup take no effect when to close the terminal end the process running in background?
body: <p><code>nohup command &amp;</code> can keep a command running after closing the terminal.
  I want to play all mp3 music in directory <code>Music</code>.</p>
  <pre><code>ls Music/*mp3 |xargs -d &quot;\n&quot; mplayer  
  </code></pre>
  <p><code>ls Music/*mp3</code> can list all mp3 files in directory <code>Music</code>, send it via pipe with xargs, <code>-d &quot;\n&quot;</code> is to treat blanks in the filenames.</p>
  <p>I want to redirect all <code>stdout</code> and <code>stderr</code> into <code>/dev/null</code>, and run it in the background.</p>
  <pre><code>ls Music/*mp3 |xargs -d &quot;\n&quot; mplayer &gt; /dev/null 2&gt;&amp;1 &amp;
  </code></pre>
  <p>This works fine, but I want it running after closing the terminal.</p>
  <pre><code>nohup ls Music/*mp3 | xargs -d &quot;\n&quot; mplayer &gt; /dev/null 2&gt;&amp;1 &amp;
  ls Music/*mp3 | xargs -d &quot;\n&quot; nohup mplayer &gt; /dev/null 2&gt;&amp;1 &amp;
  ls Music/*mp3 | nohup xargs -d &quot;\n&quot; mplayer &gt; /dev/null 2&gt;&amp;1 &amp;
  </code></pre>
  <p>When I close the terminal, the process running in the background ends.<br />
  Why does <code>nohup</code> not take effect in any of the above three commands? How can I make it take effect?</p>
  <p><code>disown</code> can solve the issue, but I would like a solution using <code>nohup</code>.</p>
  <pre><code>ls Music/*mp3 | xargs -d &quot;\n&quot; mplayer &gt; /dev/null 2&gt;&amp;1 &amp; disown
  </code></pre>