I'm writing this from my personal experience, because I broke a few systems by misusing some commands...
I wanted to save a server which wasn't booting because of a kernel update which went badly. Thus I put a FTP server on the rescue server, mounted the disk of the original server, and tried to retrieve the files. The FTP was launched as
user, the partition mounted listed files from
root, thus the FTP couldn't retrieve them.
best (actually, the worst) idea? A
chown -R user and a
chgrp -R user... This affected the mounted partition but also the original files (which is logical but I didn't think about that).
We were able to downgrade the kernel version in the /boot partition and boot it again afterward but alas, it was unusable because everything was owned by
user, even things like
TL;DR When using chown and chgrp, be extra careful.
I have a friend who was trying to create a temporary website for an association, named "abc". Well, it wasn't a success thus he tried to delete it. The first time he typed the wrong name, the second time he forgot
-r, the third there was an error and he needed to add
-f as well.
The plot twist? There was another folder for another website named "pbn", and 3 times he typed "pbn" and not "abc". The wrong website was deleted, unrecoverable.
How it could have been avoided? By having
alias rm='rm -i' in the
.bash_aliases, asking for a confirmation to delete a file (for every file if
-r was added). If you are sure and have reviewed it carefully, you can pipe the rm command with
yes which will send "y" to every prompt from
I'm hoping that I'll be able to add more commands to this article, without causing too much damage, and I also hope that this will help some of you!