当前位置:网站首页>出现Command ‘vim‘ is available in the following places,vim: command not found等解决方法
出现Command ‘vim‘ is available in the following places,vim: command not found等解决方法
2022-08-01 03:45:00 【码农研究僧】
1. 问题所示
本身vim是系统内置的命令,连vim都出现问题
出现如下问题:
[email protected]:/usr# vim ~/.bashrc
Command 'vim' is available in the following places
* /bin/vim
* /usr/bin/vim
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.
vim: command not found
截图如下:
2. 原理分析
内置命令无法识别,说明系统变量有误,导致无法识别,既然系统变量有误,将其注释或者更改为正确的即可,但是现在打不开,又怎么注释掉
2.1 方法一
通过上面的错误提示,使用/bin/vim
或者 /usr/bin/vim
替换vim来打开编辑,打开之前错误的全局变量文件,发现变量有误,要么注释要么改为export PATH=/usr/local/mongodb/bin:$PATH
修改为正确的即可,之后还需要重启服务器,使用/sbin/reboot
或者手动重启就可恢复原先的状态
2.2 方法二
本身linux 环境下
变量的改动具体有如下几种方式
vim /etc/profile
vim /etc/bashrc
vim ~/.bashrc
~/.profile
系统变量有全局变量(通过命令行printenv 或者echo)和局部变量
知道全局环境变量被破坏,写入全局环境变量即可
在命令行输入
export PATH=/usr/bin:/usr/sbin:/bin:/sbin
# 或者
export PATH=/usr/bin:/bin
之后即可成功,通过即可查看命令是否有写入
对应通过vim 修改错误的变量文件,不然source也无法让配置文件生效
边栏推荐
- 一个service层需要调用另两个service层获取数据,并组装成最后的数据,数据都是list,缓存如何设计?
- 初出茅庐的小李第112篇博客项目笔记之机智云智能浇花器实战(1)-基础Demo实现
- Ordinary users cannot access HGFS directory
- 预言机简介
- Summary of mobile page optimization in seconds
- "ArchSummit: The cry of the times, technical people can hear"
- Flutter “Hello world“ 程代码
- /etc/fstab
- button remove black frame
- 【kali-信息收集】枚举——DNS枚举:DNSenum、fierce
猜你喜欢
This article takes you to understand the past and present of Mimir, Grafana's latest open source project
MySQL3
"ArchSummit: The cry of the times, technical people can hear"
【Make YOLO Great Again】YOLOv1-v7全系列大解析(Neck篇)
Input输入框光标在前输入后自动跳到最后面的bug
How to download the Keil package
Hackers can how bad to what degree?
[Message Notification] How about using the official account template message?
时时刻刻保持敬畏之心
second uncle
随机推荐
Nmap manuals - the full version
Nmap 操作手册 - 完整版
基于STM32设计的UNO卡牌游戏(双人、多人对战)
一个service层需要调用另两个service层获取数据,并组装成最后的数据,数据都是list,缓存如何设计?
阿叶的目标
Game Theory (Depu) and Sun Tzu's Art of War (42/100)
[uniCloud] Application and Improvement of Cloud Objects
New York University et al | TM-Vec: Template Modeling Vectors for Rapid Homology Detection and Alignment
Make your Lottie support word wrapping in text fields
[Message Notification] How about using the official account template message?
The kernel's handling of the device tree
win10 fixed local IP
HCIP (14)
【入门教程】Rollup模块打包器整合
被 CSDN,伤透了心
情人节浪漫3D照片墙【附源码】
pdb药物综合数据库
HCIP(14)
大佬们,MySQL cdc source在增量过程中回收 replication slave 和 r
Open source project site must-have & communication area function