& Lt; practical training | day 4 & gt; have you mastered vim in Linux? Attach the ftp Remote Command for upload ., Vimftp

Source: Internet
Author: User

<Practical training | day 4> have you mastered vim in Linux? Attach the ftp Remote Command for upload ., Vimftp

The long-awaited linux O & M and oracle "Training Course" has finally started.I have started linux O & M and oracle training for four and a half months. I will study hard during the day. I will try to update the Tutorial at night, including what I learned today and how I used it, what tools are used, where tools are shared, etc, every old driver interested in me or not can learn a little extra knowledge in his spare time, maybe you used it a little on that day!

Certificate -------------------------------------------------------------------------------------------------------------------------------------------------

Thank you for your support. I would like to say a few words here. During the first four or five days of practical training, you may have learned the basics of knowledge. I also hope that people will take a look and give me some advice; no one will follow me to learn from the basics, but everyone should not take it for granted as simple. In actual operations, the problems you encounter far exceed your imagination, you can solve some problems easily, but I believe that not everyone can solve them quickly. Therefore, knowledge and other things are accumulated step by step. Thank you for your support!

I promise that you will be able to learn a lot about linux, oracle, and cloud computing in the next few days!

 

Day 4:

Main Content outline:

Detailed explanation:

  • Terminal usage and common shortcuts

  Terminal is the Terminal console in our linux system. Each time a Terminal is opened, it is a new shell.

① Ctrl + shift + t you can open a new shell, ctrl + shift + w force close a shell

  

② Ctrl + f move the cursor forward in the character, ctrl + B move the cursor backward in the character

③ Ctrl + a move the cursor to the beginning of the character, and ctrl + e move the cursor to the end of the character

④ Ctrl + p open the last record entered by the terminal, and ctrl + n open the next record entered by the terminal

  • The normal mode of vim. 
In linux, our commonly used editors include vim and emacs. I wonder if you have heard of this sentence. "vim is the god of editors. emacs is the editor of God! "We can see the importance of vim and emacs. The normal mode of vim, that is, the normal mode. Open a file or directly input the command vim. The normal mode is entered. In any mode, press esc to return to normal mode.

① Fa goes down to find a in the string, shift + f a goes up to find a in the string

② Replace the character at the position of the ra cursor with

③ Copy a row in yy, paste it into 3 p, and paste it three times.

④ In normal mode, x deletes a character dw, deletes a word dd, and deletes a row

⑤ K dd p swap two rows

⑥ U undo an operation ctrl + r is opposite to u

7. ctrl + g to view the current status

  

 

  • Vim command mode.

  Command mode is mostly used to operate text files (rather than the content of text files), such as saving files, or changing the editor status, such as setting multi-column windows, labels, or exiting the editor ......

① G/add/d Delete the row containing add

② V/add/d Delete rows that do not contain add

  

  • Vim visualization mode (select mode ).

  The visual mode is equivalent to the normal mode after the highlighted text is selected. The visible mode has a sub-mode. It selects the visible row mode based on the behavior unit and uses the "V" key to enter (that is, Shift + v ); and block-Based Visual block mode. Press Ctrl + v to enter.

① V select one character and then use hjkl to select the copied content p paste d Delete

② V select u to lowercase U to uppercase

③ Shift + v select one line

④ Ctrl + v Use hjkl to select a block

  

  • Vim search mode.

 In normal mode, press "/" to enter the search mode.

① S/old/new/g replace all the old in the current row of the cursor with new

② Replace the first 10 lines of s/old/new/g

③ % S/old/new/g replace all documents

  

  • Vim insert mode.

  The insert mode is used to add content to the text

① I start to input text before the character where the cursor is located and enter the insertion Mode

② A starts to input text and enters the insertion mode after the character of the cursor

③ O (letter o) open a new line under the row where the cursor is located to enter the text and enter the insert mode.

④ S Delete the character of the cursor and enter the insert mode

⑤ I enter the text at the beginning of the line and enter the insert mode. This line indicates the first non-blank character. If there is a space at the beginning of the line, enter the text after the space and enter the insert mode.

⑥ A enters the insert mode at the end of the row. This is easy to use. You don't have to worry about where the cursor is in this line. If you press A, it will be waiting for you to enter text at the end of the line.

7. O (uppercase letter O) opens a new line on the line where the cursor is located to enter the text and enter the insert mode.

S deletes the row where the cursor is located and enters the insert mode.

  

  • Ftp remotely uploads files through command lines.

The so-called requirement can be used to create, or to study with the heart. The documents and notes in the past few days are copied back using a USB flash drive. Today, I suddenly don't want to use a USB flash drive, I suddenly remembered that my server was configured with ftp, So I uploaded all the note files to my ftp. I do not have any ftp upload tool installed with graphical interfaces in Linux, So I simply use the command line mode.

① First, I installed a non-graphic ftp tool lftp in my linux. I did not talk about the installation process, and then began to connect.

② Use the command: After you press enter, you will be logged on.

Root @ localhost ~ # Lftp-u root: Password IP Address

  

③ View the uploaded files and remotely log on to my server using the command:

Root @ localhost ~ # Ssh root @ IP Address

  

④ Then I can download my uploaded files through ftp at home.

  

  • Supplement 
In linux, vim has many shortcuts. I can only list some of them. In fact, we need to know the functions of these shortcuts. At the beginning, no one can remember them, I am always familiar with the usual practice, so I still need to practice more. Here I recommend a vim exercise manual running on a linux terminal. Chinese version: vimtutor zh English version: vimtutor enIn addition, I uploaded an official document and two unofficial documents, Reply to vim. You can take a look at it at ordinary times. A vim is not as simple as we think. Learning this will greatly improve your operation efficiency in the future. The following figure is attached:
   Summary:  

The update is not very fast. Many people have learned the course in the past few days, but I promise that after the preparatory course, it is what you want to learn.

 Blog: IT male who loves his family and his wife

   Public Account: Programmer's wild banana [Public Account: You can download my tutorials, tools, notes, and other resources I share. resources may be uploaded later today, but I will update them every day.]

 

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.