BOOTING INTO THE SHELL
panorama吧
全部回复
仅看楼主
level 5
lxp_514999 楼主
If you’re really in love with the shell, you can choose to boot into it, avoiding the GUI completely (although youcan later start the GUI by typing startx at the command line).Booting into the shell is done by defining a custom run level. A run level is how the operating mode thatUbuntu is currently running in is described. For example, one particular run level might start a GUI, while anothermight start only a command prompt.There are usually seven run levels under Linux, numbered from 0 to 6. Not all of them do somethinginteresting. On Ubuntu, run levels 2 through 5 are all the same. Each runs the GUI. Run level 1 runs a commandprompt, so it might seem ideal for booting into the shell, but it also shuts down a few essential services. Thismeans it isn’t suitable for day-to-day use.The trick is to take one of the existing run levels and alter it slightly so that it doesn’t run a GUI by default.On many distributions, run level 3 is reserved for this purpose, so it makes sense to alter it under Ubuntu. (Forwhat it’s worth, the default Ubuntu run level is 2.)Stopping Ubuntu from running a GUI upon booting is simply a matter of stopping the program that appearswhen Ubuntu boots—GDM. This provides the login window that appears and starts the whole graphicalsubsystem. Type the following command at the shell to remove the shortcut to GDM within the run level 3configuration:sudo rm /etc/rc3.d/S13GDMAfter this, you’ll need to tell Ubuntu to boot straight to run level 3, rather than the default of 2. You do thisby editing the /etc/inittab file, which is one of the first configuration files Ubuntu reads when booting.Issue the following command at the shell to open the file in the Gedit text editor:sudo gedit /etc/inittabThen look for the following line, which will be near the top of the file:id:2:initdefaultAnd edit it so that it reads:id:3:initdefaultThen save the file. From now on, you’ll always boot straight to a BASH prompt. To restore things to theway they were, simply restore the line in the /etc/inittab file to the way it appeared originally.
2008年01月22日 23点01分 1
1