Linux under Cat and VI command Introduction __linux

Source: Internet
Author: User
Share a simple about Linux under the Cat and VI command Introduction article, the need for friends can refer to.

Introduction to CAT Commands
The original meaning of the cat command is a connection (concatenate) that connects multiple file contents and outputs to the standard output stream (the standard output stream defaults to the screen). In practice, we often use it to display the contents of a file. If you are familiar with the type command under MS-DOS, it is not difficult to master the cat command. A common example of this command is as follows:

Cat File1.txt Displays the contents of the File1.txt file;

Cat File1.txt File2.txt Displays the contents of file1.txt and File2.txt files;

Cat-n File1.txt Displays the contents of the File1.txt file and displays the line number;

VI Command Introduction
VI is the "Visual Interface" abbreviation, it on the status of Linux as if the edit program in DOS. It can perform output, delete, find, replace, block operations and many other text operations, and users can customize it according to their own needs, which is not available in other editing programs.

VI is not a typesetting program, it is not like word or WPS to the font, format, paragraph and other attributes of the choreography, it is just a text editing program.

VI no menu, only commands, and command a wide range. Limited to space, this article only describes the commonly used commands.

Vi has three basic modes of operation: command line mode, text input mode and last line mode.

Command-line mode:

Any time, regardless of the user in what mode, just click the "ESC" key, you can make VI into the command line mode; When you enter the VI command in the shell environment to start the VI editor, it is also in this mode.

In this mode, users can enter a variety of legitimate VI commands for managing their own documents. At this point, any character entered from the keyboard is interpreted as an edit command, and if the entered character is a legal VI command, then VI completes the corresponding action after receiving the user command (but note that the command entered is not displayed on the screen). If the input character is not a legal order VI, VI will ring alarm.

Text input mode:

Enter the Insert command I, attach command A, open command O, modify command C, replace command R, or replace command s in command mode to enter the text input mode. In this mode, any characters entered by the user are saved by VI as the file contents and displayed on the screen. In the text input process, if you want to return to command mode, press the "ESC" key.

Last line mode:

In command mode, the user presses the ":" Key to enter the final line mode, at which time VI will display the last line of the window (usually the last line of the screen) to display a ":" as a terminal mode prompt, waiting for the user to enter the command. Most file management commands are executed in this mode (such as writing the contents of the edit buffer to the file medium) after the end of the last line command, VI automatically back to command mode.

If the input command in the last line of the process changed the idea, you can press the "ESC" key or use the backspace button to delete all the input commands, and then click the Backspace key, you can make VI back to the command mode.

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.