What is vi in linux
vi in linux is an editor in text mode. It can only edit characters and cannot typeset fonts and paragraphs. The vi editor can both create new files and edit files. There are Command, Insert and Visual Three command modes.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
What is vi in Linux
Vi is a text editor developed by Bill Joy of the University of California, Berkeley.
There are many text editors, such as gedit, kwrite, and OpenOffice in graphic mode. Editors in text mode include vi and vim (an enhanced version of vi). vi and vim are our most commonly used editors in Linux. vi or vim is the most basic text editing tool in Linux. Although vi or vim does not have the simple operation of clicking the mouse like a graphical interface editor, the vi editor can never be compared to a graphical interface editor in the character interface of system management and server management. Than.
Note: vi is the most classic text editor in unix/linux operating systems. It can only edit characters, but cannot typeset fonts and paragraphs; it can both create new files and edit files; it does not The menu only has commands, and there are many commands.
Although the operation mode of vi is very different from other commonly used text editors (such as gedit), it is still frequently used because it runs on a character interface and can be used in all unix/linux environments.
Three command modes of vi
Command (command) mode, used to enter commands
Insert (insert) Mode, used to insert text
Visual mode, used to visually highlight and select text
1 .Command mode:
Command mode is the working mode entered after starting vi, and can be converted to text editing mode and last line mode. In command mode, any characters entered from the keyboard are interpreted as editing commands and will not be displayed on the screen. If the characters entered are legal vi commands, vi will complete the corresponding action; otherwise vi will ring a warning.
2. Text editing mode:
Text editing mode is used for character editing. In command mode, enter i (insert command), a (append command) and other commands to enter text editing mode. Any characters entered at this time will be displayed on the screen as file content by vi. Press the Esc key to return to command mode from text editing mode.
3. Last line mode:
In command mode, press the ":" key to enter the last line mode. At this time, vi will display the ":" symbol year as the last line at the bottom of the screen. Mode prompt, waiting for the user to enter relevant commands. After the command is executed, vi automatically returns to command mode.
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of What is vi in linux. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Linux is widely used in servers, embedded systems and desktop environments. 1) In the server field, Linux has become an ideal choice for hosting websites, databases and applications due to its stability and security. 2) In embedded systems, Linux is popular for its high customization and efficiency. 3) In the desktop environment, Linux provides a variety of desktop environments to meet the needs of different users.

Frequently asked questions and answers to CentOS interview include: 1. Use the yum or dnf command to install software packages, such as sudoyumininstallnginx. 2. Manage users and groups through useradd and groupadd commands, such as sudouseradd-m-s/bin/bashnewuser. 3. Use firewalld to configure the firewall, such as sudofirewall-cmd--permanent-add-service=http. 4. Set automatic updates to use yum-cron, such as sudoyumininstallyum-cron and configure apply_updates=yes.

The methods for basic Linux learning from scratch include: 1. Understand the file system and command line interface, 2. Master basic commands such as ls, cd, mkdir, 3. Learn file operations, such as creating and editing files, 4. Explore advanced usage such as pipelines and grep commands, 5. Master debugging skills and performance optimization, 6. Continuously improve skills through practice and exploration.

Linux beginners should master basic operations such as file management, user management and network configuration. 1) File management: Use mkdir, touch, ls, rm, mv, and CP commands. 2) User management: Use useradd, passwd, userdel, and usermod commands. 3) Network configuration: Use ifconfig, echo, and ufw commands. These operations are the basis of Linux system management, and mastering them can effectively manage the system.

The steps to start a Redis server include: Install Redis according to the operating system. Start the Redis service via redis-server (Linux/macOS) or redis-server.exe (Windows). Use the redis-cli ping (Linux/macOS) or redis-cli.exe ping (Windows) command to check the service status. Use a Redis client, such as redis-cli, Python, or Node.js, to access the server.

Redis uses a single threaded architecture to provide high performance, simplicity, and consistency. It utilizes I/O multiplexing, event loops, non-blocking I/O, and shared memory to improve concurrency, but with limitations of concurrency limitations, single point of failure, and unsuitable for write-intensive workloads.

The five pillars of the Linux system are: 1. Kernel, 2. System library, 3. Shell, 4. File system, 5. System tools. The kernel manages hardware resources and provides basic services; the system library provides precompiled functions for applications; the shell is the interface for users to interact with the system; the file system organizes and stores data; and system tools are used for system management and maintenance.

How to restart the Redis service in different operating systems: Linux/macOS: Use the systemctl command (systemctl restart redis-server) or the service command (service redis-server restart). Windows: Use the services.msc tool (enter "services.msc" in the Run dialog box and press Enter) and right-click the "Redis" service and select "Restart".
