Understand the powerful Linux console, terminal, and shell

Source: Internet
Author: User
Like other UNIX systems, Linux itself is also based on command lines. try Ctrl + Alt + F1. this is the console, which is the true form of Linux, in addition to multiple logon and logout attempts

Like other UNIX systems, Linux itself is also based on command lines. try "Ctrl" + "Alt" + "F1". This is the console, which is the original form of Linux, as for the usage method, apart from multiple logon and logout operations, the operation is similar to that of the "terminal". when X-Window has a problem or does not run X-Window, the operation is mainly completed here.

Linux provides more than one terminal in the console, supporting simultaneous logon by multiple users, including simultaneous logon on the local machine. The console "Alt" + "Fx" can be switched to the x terminal. To jump to the X terminal from x-Window, press Ctrl + Alt + Fx ".

Generally, the Linux release provides 7 virtual screens, ranging from 1 ~ The 6th is a console terminal and the 12th is running X-Window. Red Flag Linux Desktop 4.0 only provides 2 console terminals and 3rd run X-Window. if you need more console terminals, you can modify "/etc/inittab ", find the line "# Run gettys in standard runlevels". The six lines starting with numbers and "#" are Console terminal instructions. Lines starting with "#" indicate comments in most configuration files, that is, this row does not take effect. Remove those "#" and restart them to obtain all 6 console terminals.

The "rxvt" mentioned above will virtualize a terminal window in the graphic interface during runtime. since the actual functions are almost identical, from here, in this document, whether it is a "terminal" enabled in the graphic interface or a terminal logged on to the console, unless otherwise specified, it is referred to as a "terminal" without quotation marks. If necessary, it should be differentiated by "virtual terminal" and "console terminal.

Note:When logging on to the console, enter the account in "login:" and "password.

For security reasons, the entered password is not displayed. Use the "logout" command to log out on the console terminal ". Background programs started on the console are not terminated due to cancellation. As mentioned above, the console terminal is "the true face of Linux ". The command line program running on each terminal is not the terminal itself, not the Linux itself. Like X-Window, the command line program is essentially a peripheral program called "shell ".

"Shell", shell.

From the name, you may have guessed something. it is good. it contains the user interface function, which is responsible for receiving user input and sending it to the Linux kernel after translation. if there is output information, it also displays the output information. Compared with DOS, shell is equivalent to "command.com ".

Shell can also perform batch processing by concatenating several commands ". Unlike "command.com", shell functions are much more powerful. A slightly more functional shell script already has the syntax structure of a high-level language. Therefore, writing shell scripts is also considered programming in many cases.

Generally, if you log on to the console or enable "terminal" on the GUI, a shell is started by default to receive users.

You can start another shell in the shell command line.

The general command for exiting the current shell is "exit". if the current shell is started after logging on to the console, "exit" is equivalent to "logout ".

The background program started in shell will not be terminated due to normal exit. The so-called abnormal exit means to force the shell to be killed. in the graphical interface, closing the terminal in the "cross" mode is also considered to force the termination of a shell.

There are many types of shell, which have their own characteristics. Currently, shell is widely used as "bash". The main Linux distributions use it as the default shell, "bash" and other mainstream shells support inputting multiple commands at a time and starting background programs. if you want to execute multiple commands in sequence, separate the commands; if you want this program to run in the background, add "&" after the command.

Related Article

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.