title: Killing a while loop that's running in the background without a PID
body: <p>I'm a beginner in everything that is part of Linux so please take me slow.</p>
  
  <p>I've created a "script" that's running in the background: </p>
  
  <pre><code>while true; do echo "I'm alive" &gt;&gt; alive.log ; done &amp;
  </code></pre>
  
  <p>The output of the script is saved in a file alive.log that's present in the user's home directory. 
  The problem is I have no ideea how to kill the loop since it's filling my disk space, if I wish to delete the file then loop will create a new file and fill it with the text "I'm alive" as I've asked it to do. </p>
  
  <p>I tried using: </p>
  
  <pre><code>ps - aux | grep while
  </code></pre>
  
  <p>or</p>
  
  <pre><code>ps - aux | grep alive 
  </code></pre>
  
  <p>The output for the two lines will give me the PID I need but the problem is that the script is a loop which means the PID will change every time it runs itself (recursive) so I can't use the PID to kill the process. </p>
  
  <p>I also tried using:</p>
  
  <pre><code>pkill while
  killall while
  </code></pre>
  
  <p>The result for both lines is 0 (output can be seen when using pkill while -c "0" or killall while : "while: no process found";</p>
  
  <p>Any suggestions please? </p>