title: On Linux, does the remove command "rm" run in the background?
body: <p>I am trying to run my test cases which are nearly 40k with below scripts.</p>
  
  <p><strong>Just showing some part of script -</strong></p>
  
  <pre><code>#!/bin/bash
  # RUN script
  
  
  
  echo "please run with: nice nohup ./run_script"
  
  # working directory where script is stored
  WORKING_DIR=$(pwd)
  
  # temp directory to build and run the cmake ctest
  BUILD_DIR=${BUILD_DIR:-/localtemp/build}
  
  # clean and make build directory
  rm -rf $BUILD_DIR
  mkdir -p $BUILD_DIR
  mkdir -p $BUILD_DIR/../result
  
  cmake -G Ninja
  
  ninja test
  </code></pre>
  
  <p><strong>Note: I am using parallel threading with 6 cores to run my test cases .</strong> </p>
  
  <p>In first attempt all are passing which is true as I fixed all the bugs in my test cases.</p>
  
  <p>But some time If I want to re-run same script freshly, then I am getting the error in running some test cases out of 40k. But If I run that failing test cases separately(one by one) then they are passing perfectly. </p>
  
  <p>So I assumed that <code>rm -rf</code> is taking some time to delete that old binary and symbols of all cases (40 GB files). so I need to wait for complete deletion and then run my script once again . So should I add some delay after <code>rm -rf</code> command in my script .</p>
  
  <p>I read somewhere that <code>rm -rf</code> will return the status once it finishes the work .Then only next command executes. But my scnerio looks like showing that <code>rm -rf</code> is running in background.<br>
  Means I should not start new run immediately when I stopped the earlier run . I need to give some time to delete the old output from earlier run using <code>rm -rf</code> command in script (delay introduction) and run my below ninja command after that. Is that true?</p>