I hear so many stories of people accidentally typing "rm -rf *" as root and deleting the entire file structure.
Usually it's this mistake that causes the fatal error:
rm -rf / path/to/directory
Notice the accidental space between the "/" and "path"
So this is equivalent to rm -rf /
and it probably never gets as far as
rm: cannot remove "path/to directory" : No such file or directory
So this is a bad thing to type as root. Used as your username, it'll "just" remove all the entries under your /home/username
, and any files you may have in /tmp
, so you are wiped out, but the system will still continue to function normally ( root can login, and re-create your account, if not the data it held ).
Backups are important.
I once hosed my system with (as root)
cd /home/tred/oldhome-with different-UID:GID
chown -R tred:tred *
# Noticed the .files hadn't been chown'd, so..
chown -R tred:tred .*
Thought it was taking rather too long. So I <CTRL>-C'd it.
Can you work out why?
[Reinstall required (but no data lost). Lesson learnt