In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail about the use of vi commands in the linux system, the content of the article is of high quality, so share it for your reference. I hope you can get something after reading this article.
The vi editor is the standard editor for all Unix and Linux systems, and it is as powerful as any of the latest text editors.
The working mode of vi
Basically, vi can be divided into three states: command mode (command mode), insert mode (Insert mode) and bottom line mode (last line mode). The functions of each mode are as follows:
1. Command line mode command mode)
Control the movement of the screen cursor, the deletion of characters, words or lines, move and copy a section and enter the Insert mode, or to the last line mode.
2. Insert mode (Insert mode)
Text input can only be done under Insert mode, and press the "ESC" key to return to command line mode.
3. Bottom line mode (last line mode)
To save or exit vi, you can also set the editing environment, such as finding strings, listing line numbers, etc. Wait.
Some basic operations of vi
1. Enter vi
After the system prompts for the symbol vi and the file name, go to the vi full screen editing screen:
For example:
$vi myfile
It is important to note, however, that after you enter vi, you are in "command line mode (command mode)", and you have to switch to "insert mode (Insert mode)" before you can enter text.
2. Switch to insert mode (Insert mode) to edit the file
Press the letter "I" in "command line mode (command mode)" to enter "insert mode (Insert mode)" and you can start typing text.
3. Switching of Insert
You are currently in "Insert mode mode", so you can only type text all the time. If you find that you have typed the wrong word and want to use the cursor key to move back and delete the word, press the "ESC" key to go to "command line mode (command mode)" and then delete the text.
4. Exit vi and save files
Under Command Line Mode (command mode), click the: colon key to enter Last line mode, for example:
W filename (enter "w filename" to save the article with the specified file name filename)
: wq (enter "wq", save and exit vi)
: q! (enter qquit, do not save the disk and force to exit vi)
After reading the above, have you mastered how to use the vi command in the linux system? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
The above is the use of the vi command in the linux system. Is there anything to gain after reading it? If you want to know more about it, you are welcome to follow the industry information. Thank you for reading.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.