title: what's the difference between rm -rf and rm -r?
body: <p>In linux, what is the difference between 'rm -rf' and 'rm -r', both seem to do the same things (delete an entire directory).</p>
  
  <p>Here is a few commands that I ran to test it:</p>
  
  <pre><code>mohammad@mohammad-ThinkPad-E570:~/testerr$ ls
  mohammad@mohammad-ThinkPad-E570:~/testerr$ mkdir foo1 foo2
  mohammad@mohammad-ThinkPad-E570:~/testerr$ touch foo1/main.java foo2/main.java
  mohammad@mohammad-ThinkPad-E570:~/testerr$ tree
  .
  ├── foo1
  │   └── main.java
  └── foo2
      └── main.java
  
  2 directories, 2 files
  mohammad@mohammad-ThinkPad-E570:~/testerr$ rm -r foo1
  mohammad@mohammad-ThinkPad-E570:~/testerr$ ls
  foo2
  mohammad@mohammad-ThinkPad-E570:~/testerr$ rm -rf foo2
  mohammad@mohammad-ThinkPad-E570:~/testerr$ tree
  .
  
  0 directories, 0 files
  mohammad@mohammad-ThinkPad-E570:~/testerr$ 
  </code></pre>