Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Chapter V text Editor vi Command-centos7.5 knowledge

Shulou Source: shulou.com Published: 2022-06-01 07:34:34 10月03日 Update

I. Editing the contents of the document

The role of a text editor

Create or modify a text file

Maintain various configuration files in Linux system

The most commonly used text editor in Linux

Vi: the default text editor for UNIX-like operating systems.

Vim:vim is an enhanced version of the vi text editor (commonly referred to as the vi editor)

Vi vim

Three working modes

Command mode, input mode, last line mode

Switching between different modes

I plug-in

A plus type

O Edit after inserting a new row

Basic operation of command mode

Cursor movement

Copy, paste, delete

File content lookup

Undo edits and save exit

The basic operation of the last line mode

Save the file and exit the vi editor

Open a new file or read the contents of another file

File content replacement

Dw deletes a word

Save exit:

: s/old/new/gc confirms replacement on the same line

:% s/old/new/gc

Assignment:

1. Copy-paste, move-paste, single-line search and replace, full-text search and replace exercises in VI

Tags: File mode editor text content command basic operation system move different operating system between action cursor full text word commonly used version plug-in new line Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Xiaomi MySQL MariaDB NVidia