Vi is a very common full-screen file editor in the Unix world. It can be said that almost any Unix machine will provide this software, just like Windows notepad. Type vi/etc/hosts to enter the vi interface and move the cursor to the end of the file. Press ESC to run the command mode, enter A, and enter the host you wan
perform many text operations, such as output, delete, find, replace, block operations, and so on, and users can customize them according to their own needs. VI is not a typesetting program, it is not like word or WPS can be the font, format, paragraph and other properties of the orchestration, it is just a text editing program. VI There are no menus, only commands
Installation of the VIM editorVI (VIM) is a very common editor on Linux, and many Linux distributions have VI (VIM) installed by default. VI (VIM) commands are numerous but if used flexibly it will greatly improve efficiency. This article explains the operations that are mainly under CentOS.After installing CentOS, the
Common Operations
system Commands
View Host Namehostname
Modify host name (invalid after reboot)hostname Yang
Modify host name (permanent after reboot)vi/ect/sysconfig/network
Modify IP (invalid after reboot)ifconfig eth0 192.168.12.22
Modify IP (permanently effective after reboot)Vi/etc/sysconfig/network-scripts/ifcfg-eth0
View System Informationuname-aUname-r
One. The standard editor for UNIX Linux is VIVI Three state modes: Command mode, insert mode, and bottom line mode (last lines). You can generally classify the bottom row mode as command mode① Command mode: Controls the movement of the screen cursor, the deletion of characters, words or lines, and moves to copy an area and into insert mode, or bottom line mode.Note: Both the insert mode and the bottom row mode are toggled in the command mode, and when
entering the above search command) search and replace the instruction :getxt1/s//text2/options to replace the Text1 of each line with text2option=g to indicate that all Text1 in the file are superseded, and if no option is entered, Then only the first occurrence of the Text1 in each row is substituted option=go on the screen display each substituted line NBSP;OPTION=GC ask for confirmation before each string supersedes start,endgtext1/s//Text2 /options, only to find and replace line start~end.
VI is an extremely popular full-screen document editor in the Unix world, and almost any UNIX machine will provide this software as a Notepad for Windows . Type vi/etc/hostsEnter the VI interface and move the cursor to the end of the file. Press ESC to make the command mode, then enter a, and a new line to enter the ho
Vi is a widely used text editor in unix/linux. vi has various variants and different variant software on different machines. among them, vim is relatively easy to use and widely used. vim is short for ViIMproved, indicating better vi. this article describes some of the useful features,
I. general mode: the
Tags: string for select blog multiple status letter vim tmp(a) What is Vi/vim?Almost all the configuration files in the Linux world exist in plain text, and the VI editor is available on all Linux distribution systems, so it is convenient to easily modify the various configurations of the system with simple text editing software.
First I want to say that Vim and VI commands are almost the same, so learning to edit commands is easy, exclude extension correlation, and automatically complement the use of the same configuration30 Seconds to install Vim editor, 5 min to browse common commandsEnvironment: Virtual machine Ubuntu:Install vim and browse
invalidate environment variables after rebootVi/etc/profileOperationExpr $aa \* $bb multiplication, there must be a space in the middleNumber of positional parameters in the $# command$* the contents of all positional parameters$? Status returned after the last command was executed, current return status 0 is normal, non-0 indicates an exception or an error$$ the process number of the current process$! the last process number running in the backgroundThe currently executing process/program name
the line. VPS Detectivey$//Copy the contents from the cursor to the end of the line.P//Paste the contents of the Clipboard after the cursor, if the previous custom buffer is used, it is recommended to use the "AP to paste."P//Paste the contents of the Clipboard before the cursor, if the previous custom buffer is used, it is recommended to use the "AP to paste."Ix. replacement (used in the VI command mode): S/old/new//Replaces the first occurrence of
=utf-8" Sets the current file encoding format to Utf-8, or can be set to another encoding formatMulti-file editing"Vim file1 file2" Open two files at a time": N" edits the next file": N" Edit Previous file": Files" lists all files that are currently open with vimVim configuration fileThe configuration file for Vim is/ETC/VIMRC, but it is generally not recommended to modify this file directly, but to create a new hidden file in the user root directory:Vim ~/.VIMRCThen edit this file, the usual co
Vim Text Editor Common commandsSimple IntroductionVI and VIM are the most commonly used text editors on Unix/linux and are very powerful, and Vim is an upgraded version of VI. Vi is similar to Notepad in Windows, and Vim is similar to EmEditor or EditPlus in Windows. 1. Vim conversion between three modes of operation650) this.width=650; "src=" Http://s1.51cto.com
VI commandIt can be said that it is the most common command to edit files in the Unix/Linux world, but it has too many command sets, so it is not easy to be proficient in it, except for professional SA, for our developers, we only need to master some of the most common usage. The following describes some common commands:
Command
Description
NG
Jump to line N. N indicates the number o
the current folder is copied under the CSS folder, the name is unchanged CP index.html Js/index.js is the current folder under the Index.ht ml file copy is saved to the JS folder, but the name is changed to Index.js 11. Clear clears the contents of the screen instead of deleting the contents, starting from the top to show the contents of the previous reset delete, 12 from the new start. REDIRECT Echo echo Content > file name input content into this file, if there are multiple input, the
file path file copy NBSP;CP dir 1 DIR2 -R -r recursive copy file [ten] MV file's mobile file rename N BSP;MV Source file path destination file path Mobile NBSP;MV source file nbs P target file Rename [one] rm Delete NBSP;RM NBSP;-RF Force delete NBSP;RM *.txt Delete all txt files [12] Create a shared folder NB Sp CP -r source files /mnt/hgfs/share from Linux copy windows CP /mnt/hgfs/share/test.txt ./ Use from Windows Copy to
parameters$? Status returned after the last command was executed, current return status 0 is normal, non-0 indicates an exception or an error$$ the process number of the current process$! the last process number running in the backgroundThe currently executing process/program name-d is catalog file directory-e file exists exist-F is File-R whether Read permission-W Whether write permission is written-X whether there is execute permission excute-L is a symbolic connection file link-eq: Equals eq
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.