< training | Vim on the fourth day >linux do you really have the control? Attach FTP remote command upload.

Source: Internet
Author: User

long-awaited Linux operations, Oracle "training class" finally started, I have been a long 4.5 months of Linux operation and maintenance, Oracle training, every day I will study hard, evening back I will try to update the tutorial, including today learned what knowledge points, Using what method, what tools are used, where tools are shared and so on, and strive to make every interested, concern me, not concerned about my old driver can learn a little extra knowledge in their leisure time, that day you will use a little!

--------------------------------------------------------------------------------------------------------------- ----------------------------------

Thank you for your support, I would like to say two sentences, the first four or five days of training, you may learn the basis of knowledge, but also hope that people look at the two eyes, pointing out; no one follows me from the basics, but don't take it for granted that it's simple, and you're going to have more problems than you think when you actually do it. Some of you can easily solve, but there are some problems I believe not everyone can quickly solve, so the knowledge of this thing is a step by step accumulation, thank you for your support!

I'm here to make sure that over the next few days, you'll be able to learn a lot and very useful knowledge about Linux, Oracle, cloud computing!

The fourth day of the classes:

  Main content outline:

    1. terminal terminal use and common fast Czech-style
    2. vim.
    3. Vim's command mode.
    4. Vim's visualization mode (select mode).
    5. Vim's search mode.
    6. The insertion mode of vim.
    7. FTP remotely uploads files via the command line.

Detailed Explanation:

    • Use of terminal terminal and common shortcuts

  Terminal is the terminal console in our Linux system, and every open one is a new shell.

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

  

②ctrl+f the cursor moves forward in the character, ctrl+b the cursor back in the word

③ctrl+a cursor moves to the front of the character, ctrl+e the cursor to the last face of the character

④ctrl+p Open the last record of the terminal input, CTRL + N opens the next record entered by the terminal

    • The normal mode of vim. 
Linux in our commonly used editors have vim and Emacs, do not know if you have heard a word "Vim is the editor of God, Emacs is God's editor!" "The importance of vim and Emacs is visible. Vim's normal mode, known as the normal mode, opens a file or directly into the command vim, one in the normal mode, in any mode, just press ESC will return to normal mode.

①fa looks down to a in the string, shift+f a up to a in the string

②ra the character where the cursor is located, replace it with a

③yy copy a line p paste 3p paste three times

④ in normal mode, X deletes a character DW deletes a word dd deletes a row

⑤K DD P Swap two lines

⑥u Undo One Operation Ctrl+r and U opposite

⑦ctrl+g View current status

  

    • Vim's command mode.

  The command mode is used to manipulate the text file (rather than manipulating the contents of the text file), such as saving the file, or to change the state of the editor itself, such as setting a multi-column window, a label, or exiting the editor ...

①G/ADD/D Delete rows that contain add

②V/ADD/D Delete rows that do not contain add

  

    • Vim's visualization mode (select mode).

  The visual mode is equivalent to the normal mode after highlighting the selected text. The visual mode has a sub-mode, a visual row pattern selected in the behavior unit, a "V" key to enter (that is, shift+v), and a block-based visual block mode, using the "Ctrl + V" key to enter.

①v Select the copied content by following one character and select copy p paste d Delete

②v Select u to lowercase u into uppercase

③shift+v follow one line to select

④ctrl+v Select a block with HJKL according to a selection

  

    • Vim's search mode.

  Press "/" to enter search mode in normal mode

①s/old/new/g replaces all old in the current line of the cursor with new

②1,10 s/old/new/g first 10 lines replace

③% s/old/new/g Entire document replace All

  

    • The insertion mode of vim.

  Insert mode is used to add content to the text

①i starts typing text before the cursor character and enters insert mode

②a Enter text after the cursor character and enter insert mode

③o (letter O) enters text and enters insert mode by opening a separate line below the line of the cursor

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

⑤i starts typing text at the beginning of the line and enters insert mode. This line first refers to the first non-whitespace character. If there is a space at the beginning of the line, enter the text after the space and enter insert mode

⑥a enter text at the end of the line and enter insert mode. This works, you don't have to control where the cursor is on this line, just press A will wait for you to enter the text at the end of the row

⑦o (capital letter O) opens a new row above the cursor line to enter text and enter insert mode

⑧s delete the cursor line and enter insert mode

  

    • FTP remotely uploads files via the command line.

So-called there is a need to create, or to study, these days of documents and notes are copied back with a U disk, today I suddenly do not want to use a U disk, suddenly think of their server configured on the FTP, so I put all the notes files are uploaded to my ftp. I do not have a graphical interface FTP upload tool in Linux, so I use the command line mode directly.

① first I loaded a non-GUI FTP tool in my Linux lftp, the process did not say, and then began to connect.

② use command: Enter and then log in.

[Email protected]~ #lftp-u root: Password IP address

  

  ③ View the uploaded files, direct telnet to my server via command, the command is:

[Email protected]~#ssh [email protected] Address

  

  After ④ I can download my uploaded files via ftp at home.

  

    • Add 
There are many shortcuts to vim in Linux, I can only list some of them, in fact, we need to know that the function of these shortcuts can be, just start who also remember, are slowly in the usual practice of proficiency, so still more practice, I recommend a vim practice manual that runs in a Linux terminal. Chinese version: Vimtutor en English version: Vimtutor en  In addition I uploaded an official document and two unofficial documents to reply to Vim. Can usually learn, a vim is not as simple as we think, learn this, you will be more efficient operation in the future. Attach a picture again, God figure:
   Summary:  

Update is not particularly fast, these days to learn the things are preparatory, so a lot of people have learned, but I promise that after the foundation, is what you want to learn.

 Blog Park : Love family love wife of it male

Public number : program ape Wild Banana "Public number: You can download to my tutorials, tools, notes, and other resources I share, resources may be uploaded later today, but I will update every day." "    

< training | Vim on the fourth day >linux do you really have the control? Attach FTP remote command upload.

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.