Original: http://yuweiqiang.blog.163.com/blog/static/6657041201110111539474/
1. Close X Window at the image interface:
1.1 Shell runs init 3 into text mode and closes the associated service (Xserver definitely off)
1.2 Alt+ctrl+f1~f6 to character interface, root login, PS aux|grep/usr/x11r6/bin/x, get X process number,
Kill-9 process number, in fact, it has been to the text interface, there is no need to close X. (This is too rude.)
2. If you want to not enter the X Window after booting:
Edit/etc/inittab
Vi/etc/inittab
Id:5:initdefault: Change into
Id:3:initdefault:
: X File Save
: Q Exit VI
3. Open the graphical interface in text mode (X window):
Enter in the shell: StartX or init 5
1. Enter the character interface
In order to enter the console interface directly at Linux boot, we can edit the/etc/inittab file. Find Id:5: Initdefault: This line, change it to Id:3:initdefault: then reboot the system. We see that simply changing 5 to 3 will enable the conversion to enter the X-window GUI or console character interface at startup, because the Linux operating system has six different operating levels (run level) and the system has a different state at different run levels. These six operating levels are:
0: Stop (remember not to set the Initdefault to 0, as this will make Linux unable to boot)
1: Single-user mode, just like the safe mode under Win9x.
2: Multi-user, but no NFS.
3: Full multi-user mode, standard run level.
4: Generally not, in some special circumstances can use it to do some things.
5:x11, that is, into the X-window system.
6: Reboot (remember not to set Initdefault to 6, as this will cause Linux to restart continuously).
Where run Level 3 is the standard console character interface mode we want to enter.
2. Free-conversion character interface and X-window graphical interface
After understanding the start of the automatic entry X-window graphical interface and console character interface conversion, you may think, these two interface each has its own advantages, I can "greedy" point, and have both of the interface? In the omnipotent Linux operating system, This requirement is, of course, to be fulfilled.
Press the "alt+ctrl+ function key fn n=1~6" in the X-window graphical operator interface to enter the console character operator interface. This means that you can have X-window plus 6 console character interface, this is a very exciting thing Ah!
How do I get back to the X-window in the console character operator interface? Very simple, press "ALT+CTRL+F7". At this point, Linux opens 7 screens by default, numbered Tty1~tty7. After the X-window is started, the Tty7 screen is occupied, and the Tty1~tty6 is still the character interface screen. In other words, the "ALT+CTRL+FN" combination of the character interface and the X Window interface can be quickly switched.
Linux's old users are aware that X-window is a very convenient graphical interface, it can make the user with the simplest operation of the mouse, but it also has many shortcomings: such as starting and running slow, stable enough, poor compatibility, easy to crash and so on. But once the X-window system is out of order, it does not crash the entire Linux system, causing data loss or system corruption, because when X-window loses its response or crashes due to itself or an application, We can easily exit X-window into the console for troubleshooting, Just Press "Alt+ctrl+backspace" key, which means that as long as the system does not lose the response to the keyboard, x-window any problems, can easily exit.
Linux/centos turn off the graphical interface (X-window) and enable graphical interface commands