Ubuntu command line startup

Source: Internet
Author: User
Run the command line directly if Ubuntu does not start X windows.
 
Angline was released on |

1217 times read font size: large, small (0 comments by netizens) I want to comment
After Linux is started by default, it enters XWindow, but you can modify the parameters to directly access the command line interface. Whether to enter XWindow or the command line interface is performed during system initialization.

For most linux systems, the init process is used for initialization, And the/etc/inittab configuration file is used. For example

# The default runlevel
Id: 2: initdefault

# Boot-time system configuration/Initialization Script
Si: sysinit:/etc/init. d/RCS

# Runlevels
L0: 0: Wait:/etc/init. d/RC 0
L1: 1: Wait:/etc/init. d/RC 1
L2: 2: Wait:/etc/init. d/RC 2
L3: 3: Wait:/etc/init. d/RC 3
L4: 4: Wait:/etc/init. d/RC 4
L5: 5: Wait:/etc/init. d/RC 5
L6: 6: Wait:/etc/init. d/RC 6
Z6: 6: respawn:/sbin/sulogin

# How to react to Ctrl-alt-del
CAS: 12345: ctrlaltdel:/sbin/shutdown-T1-a-r now

The common format of these contents is ID: runlevels: Action: process. ID is the character sequence that uniquely identifies an item. Runlevels defines the running level used by the operation. Action specifies the specific operation to be executed. Process defines the process to be executed.

# Detailed explanation of each running level:
0 indicates that the machine is shut down.
1 is the single-user mode, just like the security mode in Win9x.
2: multi-user mode, but not supported by NFS.
3 is a complete multi-user mode, which is a standard operation level.
4. Generally, you can use it to do things in some special cases. For example, you can switch to this mode to make some settings when the battery of your laptop is exhausted.
5 is X11, And it enters the X Window System.
6. Restart the init 6 server.

The XWindow is init5 and the character is init3. Set the ID to runlevel to 3 to directly go to the text interface during system initialization.

However, UBUNTU does not use the init method and does not have the/etc/inittab file. Init uses a serial mode, which takes a long time to boot. When redhat9 is started, a large number of scripts are executed serially to start various required services (which can be seen at startup ). Ubuntu uses upstart, which is an event-based init replacement program for the Ubuntu release.

Ubuntu does not contain the/etc/inittab file, but you can add it by yourself. When/etc/inittab is in the system, UBUNTU will start according to the configuration.

Therefore, to directly enter the command line, the first method is to add the/etc/inittab. However, In Debian or Ubuntu, the default run level is 2 and 2 ~ 5 indicates the X environment. (But what is the command line? Uncertain, not tested)

In another way, you can consider stopping the running level for the corresponding running level:

$ Sudo mV/etc/rc2.d/s30tpd/etc/rc2.d/k30tpd (it may be s13tpd, not necessarily)

You can also delete the target instance from the list. Back up/etc/init. d/MCM to another location:

$ Sudo/etc/init. d/mcm/usr/TPD

Then delete/etc/init. d/TPD. After deletion, the XWindow is not started, and other services remain unchanged. You need to directly enter XWindow and copy it back.

In fact, if you only want to go to the command line interface, press CTRL + ALT + F2 on the xwindows interface to enter the character interface, and press CTRL + ALT + F7 to return to the graphic interface.

Another method is as follows:

$ Sudo apt-Get rcconf

$ Sudo rcconf

Remove the guid from the system at startup.

 

 

 

'''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''

If you want to enable commandprompt for Ubuntu every time, enter the following command:

$ Echo "false" | sudotee/etc/X11/default-display-manager

When the next boot starts, it will start in command mode. If you want to restart xwindow, you can enter:

 

$ Echo "/usr/sbin/MCM" | sudotee/etc/X11/default-display-manager

The graphic command startx is started on the text interface.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.