title: Why does the rm command not remove the file?
body: <p>When i today accessed my Ubuntu 16.04 server and wanted to remove the file "test2" it was simply not deleted!</p>
  
  <p>I have used </p>
  
  <pre><code>rm test2
  </code></pre>
  
  <p>as well as</p>
  
  <pre><code>rm -f test2
  </code></pre>
  
  <p>but it still did not delete it as you can read here: </p>
  
  <pre><code>root@icinga:~# ls
  basket  desd.save  packages  scripts  src  test2  test5  unused
  root@icinga:~# rm test2
  root@icinga:~# ls
  basket  desd.save  packages  scripts  src  test2  test5  unused
  root@icinga:~# rm -f test2
  root@icinga:~# ls
  basket  desd.save  packages  scripts  src  test2  test5  unused
  </code></pre>
  
  <p>I have also tried to remove other files, didn't work!  </p>
  
  <p>I am the owner of "test2" and using <code>ls -la test2</code> you can see that I have the rights to read and write this file!  </p>
  
  <pre><code>root@icinga:~# ls -la test2
  -rw-r--r-- 1 root root 9 Nov 11 20:33 test2
  </code></pre>
  
  <p>Using <code>which rm</code> it says <code>/bin/rm</code>.</p>
  
  <pre><code>root@icinga:~# which rm
  /bin/rm
  </code></pre>
  
  <p>And also <code>\rm test2</code> does not delete the file!  </p>
  
  <p>I have also checked for the name, there are no spaces at the end etc. because when I use <code>cat test2</code> the correct content is shown!  </p>
  
  <p>I also can create a new file but can't delete this as well.  </p>
  
  <p><code>rm</code> is also not an alias, I used <code>unalias rm</code> but it said "rm: not found".</p>
  
  <p>Reboot did also not help.</p>
  
  <p>I had the problem that I accidently deleted a file instead of moving it, so I created a script that simply moves the file to a certain directory.<br>
  Then I used <code>nano /etc/environment</code> and added ":/root/scripts" where this script was located!<br>
  After that i created the alias rms by using <code>alias rms='./rm'</code>. I know it might be dumb naming a file like a system command, I already changed it to remove!  </p>
  
  <p>But after doing all this there was the Error that rm can't be found and can be found in the following packages: coreutils. So i tried apt-get install coreutils but it said it is already installed.<br>
  So I first used <code>touch /bin/rm</code> and then <code>chmod +x /bin/rm</code>.  </p>
  
  <p>After that this problem occured!</p>
  
  <p>EDIT: the problem was the <code>/bin/rm</code> file was empty so I set up an virtual machine and copied the required file to the server!</p>