title: bash-command to invert white-list of file paths to generate black-list
body: <p>I want to convert a white-list of file paths into a  black-list (minimum length) of file paths for a given directory. </p>
  
  <p>I have a list of directories, that I want to keep  with all subfolders and files in it. </p>
  
  <p>I want to invert this information is the sense of getting:  the minimum number of "delete directory with subfolders" commands so that the result is keeping the folders of the whitelist including subfolders and files.  (Just to explain. I do not want to delete anything. )</p>
  
  <p><strong>Example:</strong> 
  data structure:</p>
  
  <pre><code>/A1/
          A2/
          B2/
                  A3
                  B3
          C2/
  /B1/
          A2/
                  A3
          B2
  /C1/
          A2
          B2
  /D1
  </code></pre>
  
  <p>whitelist.txt</p>
  
  <pre><code>/A1/B2  # also keep subdirs!
  /C1/B2
  </code></pre>
  
  <p>wanted blacklist.txt</p>
  
  <pre><code>/A1/A2
  /A1/C2
  /B1      # no subdirs in whitelist -&gt; no individual items here!
  /C1/A2  
  /D1
  </code></pre>
  
  <p><strong>I want to generate  blacklist.txt</strong> </p>
  
  <p>Is there a simple way to do it with <strong>bash commands</strong>?
  Otherwise I would like to try it with python. </p>