Earlier today I got a cold sweat moment after I accidentally ran a sudo rm /etc/group
.
I just wanted to edit a line, not to delete an entire file!
Good thing is that system occasionally backs up files in /etc
folder. If there’s group
there’s also an older group-
file.
Unfortunate that I could no longer sudo from the current user, since group
file no longer existed.
If you run into this kind of issue:
Reboot your computer
Choose Advanced options for Ubuntu

Select drop to root shell prompt
When a root terminal opens, you know what to do.

Lesson learned
Besides not doing sudo rm -rf ...
, which can happen again btw, it’s a good idea to add etc
folder to versioning.