title: Understand pipe and redirection command
body: <p>I want to understand the real power of pipe and redirection command.As per my understanding,<code>|</code> takes the output of one command result as the input of itself. And, <code>&gt;</code> is helps in output redirecting .If it is so,</p>
  
  <pre><code>find . -name "*.swp" | rm 
  find . -name "*.swp" &gt; rm 
  </code></pre>
  
  <p>why this command is not working as expected .For me above command means </p>
  
  <ol>
  <li>Find the all files recursively whose extension is .swp in current directory .</li>
  <li>take the output of <code>1.</code>  and remove all whose resulted  files .</li>
  </ol>
  
  <p>FYI,yes i know how to accomplish this task . it can be done by passing <code>-exec</code> flag . </p>
  
  <pre><code>find . -name "*.swp"-exec rm -rf {} \;
  </code></pre>
  
  <p>But as I already mentioned,i want to accomplish it with <code>&gt;</code> or <code>|</code> command.<br/> 
  If i was wrong and going in wrong direction,please correct me and explain redirection and pipe command. Where we use whose commands ? please dont mention simple book examples i read all whose thing . try to explain me some complicated thing .</p>