Ubuntu restored to fabrics(?)

Okay, so I was trying to uninstall a program called Kodi. I ran the following commands in terminal:

sudo apt-get update
sudo apt-get remove kodi*
sudo apt-get purge kodi*

I was reading it on this site: https://kodi.wiki/view/HOW-TO:Install_Kodi_for_Linux

So, the next thing it says to do is this:

rm -r ~/.kodi/

After this, I'm not sure what the terminal output was, something about the command not being able to do that because of something.

Then, Ubuntu welcome pops up, just like when you first install it. I went to desktop, it was empty, all my files gone. I restarted the PC, only to come to realize that it's a fresh installation of Ubuntu.

Can someone explain what the heck is going on?


Solution 1:

If you make a typo like add a space

rm -r ~/ .kodi/

This is treated like

rm -r ~/
rm -r .kodi/

The first one wiped all files form your user directory.

You need to be careful when using rm -r command. The second part gave you en error because the .kodi directory had been already removed.