


linux vi不显示光标的解决办法:1、登录linux系统,进入终端;2、通过执行“echo -e "\033[?25h"”方法显示光标即可。
本教程操作环境:linux5.9.8系统、Dell G3电脑。
linux vi 不显示光标怎么办?
Linux终端光标消失问题
今天在用vim写脚本的时候,突然间发现光标消失了,这就很难受了,不知道编辑位置在哪。
一开始一直在找vim的配置问题,但是后来发现终端的光标也消失了。
这才知道终端的光标和vim的光标是关联的,所以只需要把终端的光标搞出来就行了。
隐藏光标
echo -e "\033[?25l"
显示光标
echo -e "\033[?25h"
相关拓展:
在linux命令行下进行快速移动光标、命令编辑、编辑后执行历史命令、Bang(!)命令、控制命令等。让basher更有效率。
一、说明
Ctrl – k: 先按住 Ctrl 键,然后再按 k 键;
Alt – k: 先按住 Alt 键,然后再按 k 键;
M – k:先单击 Esc 键,然后再按 k 键。
二、移动光标
Ctrl – a :移到行首
Ctrl – e :移到行尾
Ctrl – b :往回(左)移动一个字符
Ctrl – f :往后(右)移动一个字符
Alt – b :往回(左)移动一个单词
Alt – f :往后(右)移动一个单词
Ctrl – xx :在命令行尾和光标之间移动
M-b :往回(左)移动一个单词
M-f :往后(右)移动一个单词
三、编辑命令
Ctrl – h :删除光标左方位置的字符
Ctrl – d :删除光标右方位置的字符(注意:当前命令行没有任何字符时,会注销系统或结束终端)
Ctrl – w :由光标位置开始,往左删除单词。往行首删
Alt – d :由光标位置开始,往右删除单词。往行尾删
M – d :由光标位置开始,删除单词,直到该单词结束。
Ctrl – k :由光标所在位置开始,删除右方所有的字符,直到该行结束。
Ctrl – u :由光标所在位置开始,删除左方所有的字符,直到该行开始。
Ctrl – y :粘贴之前删除的内容到光标后。
Alt + t :交换光标处和之前两个字符的位置。
Alt + . :使用上一条命令的最后一个参数。
Ctrl – _ :回复之前的状态。撤销操作。
Ctrl -a + Ctrl -k 或 Ctrl -e + Ctrl -u 或 Ctrl -k + Ctrl -u 组合可删除整行。
四、Bang(!)命令
!! :执行上一条命令。
foobar :把上一条命令里的foo替换为bar,并执行。
!wget :执行最近的以wget开头的命令。
!wget:p :仅打印最近的以wget开头的命令,不执行。
!$ :上一条命令的最后一个参数, 与 Alt - . 和 $_ 相同。
!* :上一条命令的所有参数
!*:p :打印上一条命令是所有参数,也即 !*的内容。
^abc :删除上一条命令中的abc。
foobar :将上一条命令中的 foo 替换为 bar
foobar^ :将上一条命令中的 foo 替换为 bar
!-n :执行前n条命令,执行上一条命令: !-1, 执行前5条命令的格式是: !-5
五、查找历史命令
Ctrl – p :显示当前命令的上一条历史命令
Ctrl – n :显示当前命令的下一条历史命令
Ctrl – r :搜索历史命令,随着输入会显示历史命令中的一条匹配命令,Enter键执行匹配命令;ESC键在命令行显示而不执行匹配命令。
Ctrl – g :从历史搜索模式(Ctrl – r)退出。
六、控制命令
Ctrl – l :清除屏幕,然后,在最上面重新显示目前光标所在的这一行的内容。
Ctrl – o :执行当前命令,并选择上一条命令。
Ctrl – s :阻止屏幕输出
Ctrl – q :允许屏幕输出
Ctrl – c :终止命令
Ctrl – z :挂起命令
七、重复执行操作动作
M – 操作次数 操作动作 : 指定操作次数,重复执行指定的操作。
相关推荐:《Linux视频教程》
The above is the detailed content of What to do if linux vi does not display the cursor. For more information, please follow other related articles on the PHP Chinese website!

MaintenanceModeinLinuxisaspecialbootenvironmentforcriticalsystemmaintenancetasks.Itallowsadministratorstoperformtaskslikeresettingpasswords,repairingfilesystems,andrecoveringfrombootfailuresinaminimalenvironment.ToenterMaintenanceMode,interrupttheboo

The core components of Linux include kernel, file system, shell, user and kernel space, device drivers, and performance optimization and best practices. 1) The kernel is the core of the system, managing hardware, memory and processes. 2) The file system organizes data and supports multiple types such as ext4, Btrfs and XFS. 3) Shell is the command center for users to interact with the system and supports scripting. 4) Separate user space from kernel space to ensure system stability. 5) The device driver connects the hardware to the operating system. 6) Performance optimization includes tuning system configuration and following best practices.

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

Linux maintenance mode can be entered through the GRUB menu. The specific steps are: 1) Select the kernel in the GRUB menu and press 'e' to edit, 2) Add 'single' or '1' at the end of the 'linux' line, 3) Press Ctrl X to start. Maintenance mode provides a secure environment for tasks such as system repair, password reset and system upgrade.

The steps to enter Linux recovery mode are: 1. Restart the system and press the specific key to enter the GRUB menu; 2. Select the option with (recoverymode); 3. Select the operation in the recovery mode menu, such as fsck or root. Recovery mode allows you to start the system in single-user mode, perform file system checks and repairs, edit configuration files, and other operations to help solve system problems.

The core components of Linux include the kernel, file system, shell and common tools. 1. The kernel manages hardware resources and provides basic services. 2. The file system organizes and stores data. 3. Shell is the interface for users to interact with the system. 4. Common tools help complete daily tasks.

The basic structure of Linux includes the kernel, file system, and shell. 1) Kernel management hardware resources and use uname-r to view the version. 2) The EXT4 file system supports large files and logs and is created using mkfs.ext4. 3) Shell provides command line interaction such as Bash, and lists files using ls-l.

The key steps in Linux system management and maintenance include: 1) Master the basic knowledge, such as file system structure and user management; 2) Carry out system monitoring and resource management, use top, htop and other tools; 3) Use system logs to troubleshoot, use journalctl and other tools; 4) Write automated scripts and task scheduling, use cron tools; 5) implement security management and protection, configure firewalls through iptables; 6) Carry out performance optimization and best practices, adjust kernel parameters and develop good habits.


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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

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

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools