restarting X Window Server from command line in linux

To restart your X Window Server from the command line in linux, without affecting any non-graphical programs (but losing any unsaved information in your graphical user interface programs), you can use the following:

sudo systemctl restart display-manager