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 face of Linux. The usage method is similar to the "terminal" except for logon and logout. 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,Multiple users can log on at the same time, including simultaneously logging on to 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. Yes, it includes the user interface function, which is responsible for receiving user input, translating and sending it to the Linux kernel for processing. If there is output information, it will also display 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, the terminal is closed in the "Cross" way, and a shell is forcibly terminated.

Shell has many features. 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 them with ";". If you want to run this program in the background, add "&" after the command.

Related Articles]

  • Xwindow language selection in Linux
  • Introduction to Xwindow International Environment (Xi18n)
  • Make AIX support essential file sets for xWindows

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.