Many systems have no important files in
If you use
sudo to perform administrative tasks, then
/root/.bash_history would never be created in the first place, and the other files in your directory listing would most likely remain static at all times.
As such wiping
/root is on the harmless end of the spectrum of destruction you can do to a Linux system.
/root does not prevent logins using
sudo. It does prevent direct login as
root using ssh keys for authentication. But the error message in that case would be different.
segmentation fault error message is not caused by missing files. It can however be caused by corrupted files. However since the files on your listing are text files and not binaries, it is unlikely for corruption in those to trigger a segmentation fault.
.bashrc is executed by the shell you open and since it does have access to execute arbitrary code, it is in theory possible to put code in there to trigger a segmentation fault and log you out again. But that's not something which happens by accident.
Another possible explanation is that there is some code being used in the login process which is missing error handling and causing a segfault by trying to use a
NULL pointer which it got from a library function to indicate a missing file. If you have found such a case you should file a bug report against the program segfaulting, and then recreate the file to mitigate the problem.
Recreating the files in
/root can be done either by reinstalling the package which owns the files installed in
/root by default or by copying from
/etc/skel which is where newly created users otherwise get their initial files from.