Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

First experience of VI (visual edit)

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Some time ago, under the instruction of Brother Qiu Xiang, I began to study Solaris. I did not follow the steps that Brother Qiu Xiang said. I first found a website on the Internet where I can learn Solaris for free. Through Fterm, I can log in to the Solaris server they provide to learn! Familiarize yourself with VI for the time being.) X4100/Solaris system:

Hardware environment: 2 AMD Opteron 280chips, CPU frequency 2.4GHz, dual core single thread, configured with 4 GB memory

Software environment: Solaris 10 Update 3 for x84/x64 configuration is OK? Ha ha, we use F-TERM to connect to the server, we can operate, this server can use editors such as VI,VIM. I use VI to operate:

The above-bash-3.00$ is a normal user. We type the command: su-and the following screen appears:

If you know the root password, you can. :) ls-a lists all the files in the directory (the so-called permissions) and a lot of ls commands, so don't write. :) thanks to Brother Qiuxiang for instructing me to enter the VI editing interface (command mode just after entering). There are two modes of VI. At first, I didn't know it, but I thought it wouldn't work. Finally, I read brother Qiu Xiang's blog to know that VI has two modes. First, insert mode, press the letter I, and enter the insert mode. The second command-line mode, press ESC to return to the command-line mode, the system does not prompt you in which mode, keep pressing ESC, until it keeps calling, indicating that you can command it:) I do this: press enter and quit. Some commands to leave VI:: Q! Leave the vi and discard what you just edited in the buffer.

Wq writes the data in the buffer to disk and leaves vi

ZZ is the same as wq

W writes the data in the buffer to disk, but does not leave vi.

: Q leaves vi, if the file has been modified, it will be asked to confirm whether to discard the modified content. This instruction can be used with: W. It's a simple experience. Ha ha, and then continued the above operation, began to be proficient in Solaris cursor movement. When moving, you must switch to command line mode, ESC+h/j/k/l is left / down / up / right respectively, what is more depressing is that I think the arrow on the keyboard can not operate the cursor, so everything needs to be operated in command mode! (UNIX's mind? Text is text, commands are commands) here are some VI commands from copy: X-the easiest way to delete a character to delete text is to use x. The result of this command is the disappearance of the character in which the cursor is located, and the following text moves to the left. If the character you delete is the last character on a line, the cursor will move one to the left so that the cursor does not stay below a character that does not exist. If there are no more words, the horn will call. D-there are also certain text objects on the right side of the command to delete objects. A text object is a piece of text. What he connects to the right are the characters that control the movement of the cursor. For example, w represents the previous word, then dw deletes the next word. 5w means move forward 5 words, then d5w will delete them. Dd-- delete one of the most commonly used d-series commands on a line. As before, 5dd deletes five lines of D-- the entire delete uppercase D is used to delete from the cursor to the end of the line. It has the same effect as d $. U-do you have to regret your recovery? He not only undoes the deletion, but also undoes all your editing work. . -- repeat the editing work. Add something about the set command. : set sw (defines the number of spaces for backward tabs when using ai)

: set ai (in insert mode, keep indenting, used with sw)

: set aw or noaw (auto write)

: set nu or nonu (number / nonumber)

Set sm or nosm (with parentheses or curly braces)

: set showmode or noshowmode

: set report

: set scrool (using ctrl + d or u)

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report